OPEN FILE: 3105 GEOLOGICAL SURVEY OF CANADA Version 2.1 November/2000 REVISED: July/2003 December/2004 September/2005 NEW: In version 2.1. Utilities TWPPOLY.EXE and GEOPROJ3.EXE. PROGRAM: TWPGRID, GISGRID, and related DOS utilities AUTHORS: D. W. Lepard & K. N. Nairn TWPGRID: The program generates a plot file of either a composite of one or more of the Western Canada Township-Range grid, BC-NTS based grid, and Canada Lands grid-area series or an NTS grid or a Global Degree grid. The composite grid may be drawn down to Section and/or Unit level in a separate plotfile which logically overlays the primary grid. The NTS grid overlay may be drawn down to 12 subdivisions similar to the BC-NTS primary grid. The Global Degree grid may be further subdivided by user specified Intervals/Degree. Scaled Projections include UTM, Lambert conformal, or Polyconic. Note that the UTM grids are actually Mercators which employ the standard UTM scale factor 0.9996 and set the Easting Origin to 500,000; the Central Meridian is user specified rather than just restricted to the center of a given UTM zone; the Northing origin in the southern hemisphere is kept at 0 rather than set to 10,000,000 and this gives a uniform scale across the equator if the normal convention of selecting the Base Latitude (origin) at the equator (0 deg.) is followed. Northings are positive in the northern hemisphere and negative in the southern hemisphere. Note also that Latitude and Longitude obey the NW sign convention; latitudes (N/S) are (+/-), longitudes (W/E) are (+/-). Output file formats include 'neutral' binary, ASCII x,y, ipen, 'Surfer', or AutoCAD DXF plotfile for grid only; no location annotation is provided. The program uses provided files for West Coast/Alaska boundary, Alberta/ BC mountain boundary, Manitoba/Hudson Bay boundary and Hudson Bay/Hudson Strait/Ungava Bay/East Coast Boundary. The user provides a program interface to user-defined plotter environment. PROMPTS: See file \TWPGRID\TWPGRID.PRM NAD83/27: The Oil and Gas industry and the provinces use the NAD27 grid. The NAD83 grid consists in applying the National Transformation to the NAD27 Lat & Long values at the Twp-Rge section corners and the BC-NTS unit corners. Results, not amenable to calculation, are available from the provinces. NAD83 Projection values are calculated using the GRS 80 spheroid instead of the Clarke 1866 spheroid. Our Twp-Rge grid consists of calculated values smoothed by adjusting baseline and range values to agree with NAD27 results. This is done primarily in regions of Alberta with extensive well data. Our BC-NTS and Canada Lands grids are simply NAD27 theoretical grids. Projection calculations use the GRS 80 or Clarke 1866 spheroid for the NAD83 or NAD27 datum, respectively. The NAD83 maps have a built-in error due to the discrepancy between NAD27 and NAD83 latitude and longitude values of the grid. DECTODMS: Utility converts input file of LAT & LONG decimal-degree records to output degree-minute-second (dddmmss.ss) file. The user specifies input record size; output record is input record with LAT & LONG replaced with converted value. DMSTODEC: Utility converts input file of LAT & LONG degree-minute-second (dddmmss.ss) records to output decimal-degree file. The user specifies input record size; output record is input record with LAT & LONG replaced with converted value. FLAND: Utility converts input file of LAT & LONG records to output Twp/Rge, BC/NTS, Frontier Location string. User may elect to let program determine which one or force to a specific one. Program string choice crude: assumes Twp/Rge south of Lat 60 and either east of Long 120 or in Peace River block (Lat 55.628 - 56.675 and Long 120 - 121.960); BC/NTS south of Lat 60 and west of Long 120 and not in Peace River block; Frontier north of Lat 60. Output record is input record with a 25 byte leader giving location string. Note integer parameters in string include leading zeros. String Format is: Twp/Rge ==> Ls-Sc-Twp-RgMn (eg. 03-24-096-14W4) BC/NTS ==> Q-iun-G/iPQ-L-Sx (eg. B-064-K/094-M-14) Frontier ==> U-Sc/LTmm-LONmm (eg. J-76/7210-11730) Note the Frontier Sc is mod 100 so that 00 is used instead of 100; the latter part specifies the north-east grid corner lat and long in degrees and minutes. FLAND2: Same as FLAND except integer parameters in location string do not include leading zeros. GEOPROJ: Utility converts input file of LAT & LONG records to output PROJECTION file. The user selects UTM, Lambert, or Polyconic projection. The user provides projection specs, input format. Note UTM projection prompt "UTM scale factor or 0" allows other than UTM scale factors; 0 defaults to UTM factor 0.9996. Output is in fixed format and includes the input LAT & LONG with up to 40 bytes of text. GEOPROJ2: Utility converts input file of LAT & LONG records to output PROJECTION file. The user selects UTM, Lambert, or Polyconic projection. The user provides projection specs, input format. Note UTM projection prompt "UTM scale factor or 0" allows other than UTM scale factors; 0 defaults to UTM factor 0.9996. Output record is input record with a 25 byte leader giving projection x,y values. GEOPROJ3: Utility converts input file of LAT & LONG records to output PROJECTION file. The user selects UTM, Lambert, or Polyconic projection. The user provides projection specs, input format. Free format is also permitted, if records start with LAT, LONG or LONT, LAT. Output record is input record with a 25 byte leader giving projection x,y values. GEOUTM: Utility converts input file of LAT & LONG records to output PROJECTION file. The user selects UTM, Lambert, or Polyconic projection. The user provides projection specs (UTM choice may optionally calculate standard zone from input lat & long), input format. Note UTM projection prompt "UTM scale factor or 0" allows other than UTM scale factors; 0 defaults to UTM factor 0.9996. Output record is input record with a 25 byte leader giving projection x,y values (UTM option, above, also gives the zone). GETLOC: Utility reads cUID, cName, Lat_deg, Lat_min, Lat_sec, cLat_dir, Long_deg, Long_min, Long_sec, cLong_dir, nUTMZone, xUTMEasting, yUTMNorthing, NTSPQ, cNTSLetr, NTSSix in free format. Output is cUid, yLat_max, xLong_max, yLat_min, yLong_min in comma and quote delimited fixed format. Output Longitude West is negative. Routine tries to get values from UTM, deg_min_sec, NTS in that order. The first 2 cases give a single value (max=min) and the latter case gives a max and min pair describing the area. GISGRID: Version of TWPGRID suitable for production of shape files using ARCINFO. User should select only one of the TwpRge, BCNTS, Canada Lands grids. Computation can be stopped at either coarse grid or fine grid level. The additional lines, required for the fine level, are given in a second file. Points, optional, are required for shape file production and are only done for the lowest level. The area associated with each point is named in the Layer name. Boundary control in TWPGRID is replaced by a coarser over- extended region which the user may elect to truncate, as desired, in ARCINFO. The NTS grid option may be stopped at any level - primary quadrangle, lettered quadrangle, sixteenth quadrangle, or a finer level equivalent to the BC grid block. Points are produced only for the finest level. The GLOBE grid option is simply carried out, as before, to the specified number of subdivisions per degree interval. Points are produced for finest level. Note that the UTM grids are actually Mercators which employ the standard UTM scale factor 0.9996 and set the Easting Origin to 500,000; the Central Meridian is user specified rather than just restricted to the center of a given UTM zone; the Northing origin in the southern hemisphere is kept at 0 rather than set to 10,000,000 and this gives a uniform scale across the equator if the normal convention of selecting the Base Latitude (origin) at the equator (0 deg.) is followed. Northings are positive in the northern hemisphere and negative in the southern hemisphere. Note also that Latitude and Longitude obey the NW sign convention; latitudes (N/S) are (+/-), longitudes (W/E) are (+/-). Output file format is AutoCAD DXF plotfile only. GRIDPOLY: Revised form of GRIDSQ (see below). Utility converts input file of a section or sub-section (LSD or section quarter or half) for given Twp, Rge, and Meridian (W,E is +,-) to output file of either lat & long or projection coordinates for a closed polygon defined by 5 points at the 4 Section, Quarter section, Half section or LSD corners (extended to include any roads). Note UTM projection prompt "UTM scale factor or 0" allows other than UTM scale factors; 0 defaults to UTM factor 0.9996. Input file assumes LSD value occurs in same field as section Quarter or Half code (format A2); section, township, range, and meridian are integers. Output file has 1 record for each point consisting of the (x,y) coordinates, the input record number as polygon identifer, followed by the input record. GRIDSQ: Utility converts input file of a section quarter and/or LSD, Sec, Twp, Rge, and Meridian (W,E is +,-) to output file of either lat & long or projection coordinates at the 4 Section, Quarter section, or LSD corners (extended to include any roads). Note UTM projection prompt "UTM scale factor or 0" allows other than UTM scale factors; 0 defaults to UTM factor 0.9996. NTSCHEK: Utility outputs 2 NTS map sheet corners in Geographic and UTM, at lower right and upper left. User selects Map Level (Primary, Letter, Sixteenth), Map Geographic Range, North American Datum, and specifies the output file name. PROJGEO: Utility converts input file of PROJECTION X, Y records to output LAT & LONG file. The user selects UTM or Lambert projection. The user provides projection specs, input format. Note UTM projection prompt "UTM scale factor or 0" allows other than UTM scale factors; 0 defaults to UTM factor 0.9996. Output record is input record with a 25 byte leader giving Lat & Long values. SPOT: Utility determines grid parameters, including north and east offsets from a reference corner, from prompted Lat & Long and grid type. The grid type may be DLS Twp-Rge, BC-NTS, or Canada Lands. TEST: Utility computes Lat & Long from prompted WELLID and distance from a reference corner. These Lat & Long values are then used to reverse the calculation and determine the grid parameters (see SPOT above). Lat & Long and reverse parameters are displayed. The program TEST is a cross test to verify the consistency of SPOT. TOLATLON: Utility converts input UTM file to output LAT & LONG file. The user specifies input record size; output record is input record with a user specified LAT & LONG insertion. Note UTM projection prompt "Default UTM scale factor or 0 if not given in file" allows other than UTM scale factors; 0 defaults to UTM factor 0.9996. TWPPOLY: Utility finds NAD27 polygon for Twp-Rge area. User is prompted for projection system (none for Lat,Long), starting Twp-Rge(SE corner of area), ending Twp-Rge(NW corner of area). UTMGEO: Utility computes Lat & Long in degrees, minutes, and seconds from prompted UTM northing, easting, and UTM zone/central meridian and reference latitude(0). Note UTM projection prompt "UTM scale factor or 0" allows other than UTM scale factors; 0 defaults to UTM factor 0.9996. Execution is terminated by reply 0, 0 for northing, easting. UTMGEO2: Utility converts input UTM file to output LAT & LONG file. User specifies default UTM zone or central meridian and reference latitude if not given in input file. Note UTM projection prompt "Default UTM scale factor or 0 if not given in file" allows other than UTM scale factors; 0 defaults to UTM factor 0.9996. Output record is input record with a 25 byte leader giving latitude and longitude. UTMGRID: Utility generates Latitude and Longitude values for UTM grid intersection points. User specifies NAD27 or NAD83, the UTM zone Central Meridian and Base Latitude, a Latmin and Latmax used, along with the longitude zone boundaries, to window the grid, the X and Y increment in km and the output file name. The output file is a file of (1)Y-lines, starting from most easterly and (2)X-lines, starting from most southerly. Each record gives one point on the line. Each set of lines is headed by a title specifying the information in each record: ZONE, UID (running number), LEVEL (100, 10, 1 for every 100km, 10km, 1km) LINE (metres East or North), LATITUDE, LONGITUDE. UTMTOGEO: Utility converts input UTM file to output LAT & LONG file. Note UTM projection prompt "Default UTM scale factor or 0 if not given in file" allows other than UTM scale factors; 0 defaults to UTM factor 0.9996. WELLID: Utility computes Lat & Long, UTM Northing & Easting from prompted WELLID, north and east offsets from a reference corner, and projection specs. Note UTM projection prompt "UTM scale factor or 0" allows other than UTM scale factors; 0 defaults to UTM factor 0.9996. The WELLID may be in one of Canada Lands, BC-NTS, or Prairie Provinces DLS (TWP-RGE-MER) format. Central Meridian and Reference Latitude values respectively default to the standard UTM zone and the equatorial reference. WELLID2: Utility converts input file of WELLID, Xeast and Ynorth metre offsets from either a reference corner which replaces characters 2,3 of the WELLID or the centre of the smallest unit to LAT,LONG and PROJECTION X,Y. See WIDGEO in GEOLIB.DOC. The user selects UTM, Lambert, or Polyconic projection. The user provides projection specs, input format. Note UTM projection prompt "UTM scale factor or 0" allows other than UTM scale factors; 0 defaults to UTM factor 0.9996. Output is in comma and quote delimited fixed format and includes all input data. WELLIDBC: Utility converts input file of QTR,UNIT,BC,PQ,LQ,SIX records to output file of LAT,LONG and PROJECTION X,Y determined at the centre of the QTR unit. The user selects UTM, Lambert, or Polyconic projection. The user provides projection specs, input format. Note UTM projection prompt "UTM scale factor or 0" allows other than UTM scale factors; 0 defaults to UTM factor 0.9996. Output is in comma and quote delimited fixed format and includes all input data. WELLPROJ: Utility converts input file of LSD,SEC,TWP,RGE,MER,Zval records to output file of LAT,LONG and PROJECTION X,Y, Zval, determined at the centre of the LSD. Note Meridian (W,E) is (+,-). The user selects UTM, Lambert, or Polyconic projection. The user provides projection specs, input format. Note UTM projection prompt "UTM scale factor or 0" allows other than UTM scale factors; 0 defaults to UTM factor 0.9996. Output is in comma and quote delimited fixed format and includes all input data. WELLPRJ2: Utility converts input file of LSD,SEC,TWP,RGE,MER records to output LAT & LONG file determined at the centre of the LSD. Note Meridian (W,E) is (+,-). The user provides input format. Output record is input record with a 25 byte leader giving LAT & LONG values. WELLSCPR: Same as WELLPROJ except LSD is replaced by the 2-character string CLS with values {'NE','NW','SE','SW','NH','SH','EH', 'WH',' ','01'..'16'} indicating either LSD value or, if not given, the section quarter or half if available (the H may be a blank). Calculations are at the centre of the appropriate entity, which is the section centre if no information is given. WELLSCPT: Same as WELLSCPR except the Zval is in character format with up to 20 characters. WELLTEXT: Utility converts input file of LSD, SEC, TWP, RGE, MER, Text(20 char) records to output file of LAT,LONG and PROJECTION X,Y, Text, determined at the centre of the LSD. Note Meridian (W,E) is (+,-). The user selects UTM, Lambert, or Polyconic projection. The user provides projection specs and input format. Note UTM projection prompt "UTM scale factor or 0" allows other than UTM scale factors; 0 defaults to UTM factor 0.9996. Output is in comma and quote delimited fixed format and includes all input data. INSTALLATION: Source, Library and Executable files are provided in a self-expanding PKZIP format. To install the system: Type H: { H represents your hard drive } Type CD \ Insert disk in drive F:{F represents your 3.5" drive } Type F:\pkzgrid.exe -d Files will be expanded in H:\TWPGRID and subdirectories EXECUTABLES: \TWPGRID directory has TWPGRID.EXE, GISGRID.EXE and utilities: DECTODMS.EXE, DMSTODEC.EXE, FLAND.EXE, FLAND2.EXE, GEOPROJ.EXE, GEOPROJ2.EXE, GEOPROJ3.EXE, GEOUTM.EXE, GETLOC.EXE, GRIDSQ.EXE, GRIDPOLY.EXE, NTSCHEK.EXE, PROJGEO.EXE, SPOT.EXE, TEST.EXE, TOLATLON.EXE, TWPPOLY.EXE, UTMGEO.EXE, UTMGEO2.EXE, UTMGRID.EXE, UTMTOGEO.EXE, WELLID.EXE, WELLID2.EXE, WELLIDBC.EXE, WELLPROJ.EXE, WELLPRJ2.EXE, WELLSCPR.EXE, WELLSCPT.EXE, WELLTEXT.EXE. CONTROL DATA: \TWPGRID directory contains files WESTCORD.DAT, BORDCORD.DAT, MANCORD.DAT, EASTCORD.DAT, which contain digitized West Coast/Alaska, Alberta/BC Mountain, Manitoba/Hudson Bay, Hudson Bay/Hudson Strait/Ungava Bay/East Coast boundaries. SOURCE CODE: Directory \TWPGRID\SOURCE contains all Fortran source code. LIBRARY: Directory \TWPGRID\GEOLIB contains Fortran subroutines and GEOLIB.LIB library and GEOLIB.DOC documentation for Lambert, Polyconic, and Well-ID to geographic coordinate conversions. REQUIREMENTS: PC 386 with a math coprocessor. Executables were generated under DOS5.0 with Fortran 5.1 compiler. Batch files mklib.bat, mkexe.bat in \TWPGRID directory can be used to regenerate the library and executables, if necessary and if the FORTRAN compiler (not provided here) is installed. REFERENCES: Williams, R.T., 1995, Lambert and Mercator map projections in geology and geophysics, Computers and Geosciences Vol. 21, pp. 353-364 Newton, G.D., 1985, Computer programs for common map projections, U.S. Geological Survey Bulletin 1642. NO WARRANTY: Although every effort has been made to ensure accuracy, this open file report has not been edited for conformity with Geological Survey of Canada standards. These digital files are provided on an "as is" basis and Canada makes no guarantees, representations or warranties respecting these files, either expressed or implied, arising by law or otherwise, including but not limited to, effectiveness, completeness, accuracy or fitness for a particular purpose. MAINTAINED BY: DW Lepard @ ISPG - Calgary. Bus: (403) 292-7028 Fax: (403) 292-5377 internet: dlepard@nrcan.gc.ca