Sfoglia il codice sorgente

move proj-related files from etc/ to etc/proj

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@49929 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 13 anni fa
parent
commit
b54f3e9bc2

+ 4 - 4
general/g.proj/g.proj.html

@@ -43,8 +43,8 @@ than as a directly-supplied command-line parameter.</dd>
 co-ordinate system in the <a href="http://www.epsg.org/CurrentDB.html">EPSG 
 database</a>. EPSG code support is based upon a local copy of the GDAL CSV 
 co-ordinate system and datum information files, stored in the directory 
-${GISBASE}/etc/ogr_csv. These can be updated if necessary to support future
-revisions of the EPSG database.</dd>
+<tt>$GISBASE/etc/proj/ogr_csv</tt>. These can be updated if necessary
+to support future revisions of the EPSG database.</dd>
 </dl>
 
 <p>The -p, -j, -w, etc. flags are all functional when importing projection
@@ -70,8 +70,8 @@ this.
 <p>If the input co-ordinate system contains a datum name but no
 transformation parameters, and there is more than one suitable parameter set
 available (according to the files datum.table and datumtransform.table in
-${GISBASE}/etc), g.proj will check the value of the <em>datumtrans</em>
-option and act according to the following:<br>
+<tt>$GISBASE/etc/proj</tt>), <em>g.proj</em> will check the value of
+the <em>datumtrans</em> option and act according to the following:<br>
 <strong>-1:</strong> List available parameter sets in a GUI-parsable (but also
 human-readable) format and exit.<br>
 <strong>0 (default):</strong> Continue without specifying parameters - if 

+ 1 - 5
general/g.setproj/Makefile

@@ -8,8 +8,4 @@ DEPENDENCIES = $(GPROJDEP) $(GISDEP)
 
 include $(MODULE_TOPDIR)/include/Make/Module.make
 
-default: cmd $(ETC)/proj-desc.table $(ETC)/proj-parms.table $(ETC)/proj-units.table
-
-$(ETC)/%.table: %.table
-	rm -f $@
-	$(INSTALL_DATA) $? $@
+default: cmd

+ 5 - 5
general/g.setproj/README

@@ -5,7 +5,7 @@ List-Archive: <http://grass.itc.it/pipermail/grass-dev>
 
 The relevant files (all installed into $GISBASE/etc) are:
 
-1. proj-parms.table
+1. parms.table
 
 One line for each known projection. A sample entry:
 
@@ -19,7 +19,7 @@ The remainder of the line (after the colon) is a semicolon-separated
 list of parameter definitions of the form parm=spec. The LHS is the
 parameter name as used by geo.h; these don't necessarily match the
 corresponding the proj parameter, but you can translate them using the
-proj-desc.table file (see below).
+desc.table file (see below).
 
 The RHS has two parts, separated by a comma. The first part is either
 "ask" or "noask", corresponding to whether or not g.setproj should
@@ -28,14 +28,14 @@ default value. Note that the combination "noask,nodfl" never occurs;
 if an option is marked as "noask", there will always be a default
 value.
 
-2. proj-desc.table
+2. desc.table
 
 One line for each known parameter (other than +proj=). A sample entry:
 
 	LON0:lon:lon_0:Central Meridian
 
 The first field is the parameter name as used by the old geo.h file,
-and as used in proj-parms.table.
+and as used in parms.table.
 
 The second field is the type, and can be one of:
 
@@ -51,7 +51,7 @@ file.
 The fourth field is a textual description of the parameter.
 
 
-3. proj-units.table
+3. units.table
 
 One line for each known distance unit. A sample entry:
 

+ 1 - 1
general/g.setproj/g.setproj.html

@@ -50,7 +50,7 @@ be used, otherwise it is determined by the datum being used.
 <p>If the datum or ellipsoid required are not 
 listed within this program, the user/administrator may add the definition 
 to the files datum.table, datumtransform.table and ellipse.table in the
-$GISBASE/etc/ directory.
+<tt>$GISBASE/etc/proj</tt> directory.
 
 <p>Depending on the projection selected, the user will then be prompted for
 the various other parameters required to define it.

+ 1 - 1
general/g.setproj/get_stp.c

@@ -89,7 +89,7 @@ int get_stp_num(void)
     int record, icode, reccnt, special_case;
     char STabbr[50], COname[50];
 
-    sprintf(FIPSfile, "%s/etc/FIPS.code", G_gisbase());
+    sprintf(FIPSfile, "%s/etc/proj/FIPS.code", G_gisbase());
 
 
     for (;;) {

+ 2 - 2
general/g.setproj/local_proto.h

@@ -5,8 +5,8 @@
 #define SP_UNKOWN    3
 
 /* $GISBASE-relative locations of parameter files */
-#define STP1927PARAMS "/etc/state27"
-#define STP1983PARAMS "/etc/state83"
+#define STP1927PARAMS "/etc/proj/state27"
+#define STP1983PARAMS "/etc/proj/state83"
 
 #define RADIUS_DEF 6370997.
 

+ 5 - 5
general/g.setproj/proj.c

@@ -13,7 +13,7 @@ struct proj_unit *get_proj_unit(const char *arg)
     struct proj_unit *unit;
     FILE *fp;
 
-    sprintf(buf, "%s/etc/proj-units.table", G_gisbase());
+    sprintf(buf, "%s/etc/proj/units.table", G_gisbase());
 
     fp = fopen(buf, "r");
     if (!fp)
@@ -51,7 +51,7 @@ struct proj_desc *get_proj_desc(const char *arg)
     struct proj_desc *res;
     FILE *fp;
 
-    sprintf(buf, "%s/etc/proj-desc.table", G_gisbase());
+    sprintf(buf, "%s/etc/proj/desc.table", G_gisbase());
 
     fp = fopen(buf, "r");
     if (!fp)
@@ -93,7 +93,7 @@ struct proj_parm *get_proj_parms(const char *arg)
     int done;
     FILE *fp;
 
-    sprintf(buf, "%s/etc/proj-parms.table", G_gisbase());
+    sprintf(buf, "%s/etc/proj/parms.table", G_gisbase());
 
     fp = fopen(buf, "r");
     if (!fp)
@@ -165,7 +165,7 @@ struct proj_parm *get_proj_parms(const char *arg)
 	    parm->ask = 0;
 	else {
 	    parm->ask = 1;
-	    G_warning(_("Unrecognized 'ask' value in proj-parms.table: %s"),
+	    G_warning(_("Unrecognized 'ask' value in parms.table: %s"),
 		      ask);
 	}
 
@@ -175,7 +175,7 @@ struct proj_parm *get_proj_parms(const char *arg)
 	    parm->def_exists = 1;
 	else {
 	    parm->def_exists = 0;
-	    G_warning(_("Unrecognized default value in proj-parms.table: %s"),
+	    G_warning(_("Unrecognized default value in parms.table: %s"),
 		      dfl);
 	}
     }

+ 5 - 5
gui/wxpython/location_wizard/wizard.py

@@ -1843,10 +1843,10 @@ class LocationWizard(wx.Object):
         transformlist = list()
 
     def __readData(self):
-        """!Get georeferencing information from tables in $GISBASE/etc"""
+        """!Get georeferencing information from tables in $GISBASE/etc/proj"""
 
         # read projection and parameters
-        f = open(os.path.join(globalvar.ETCDIR, "proj-parms.table"), "r")
+        f = open(os.path.join(globalvar.ETCDIR, "proj", "parms.table"), "r")
         self.projections = {}
         self.projdesc = {}
         for line in f.readlines():
@@ -1868,7 +1868,7 @@ class LocationWizard(wx.Object):
         f.close()
 
         # read datum definitions
-        f = open(os.path.join(globalvar.ETCDIR, "datum.table"), "r")
+        f = open(os.path.join(globalvar.ETCDIR, "proj", "datum.table"), "r")
         self.datums = {}
         paramslist = []
         for line in f.readlines():
@@ -1886,7 +1886,7 @@ class LocationWizard(wx.Object):
         f.close()
 
         # read ellipsiod definitions
-        f = open(os.path.join(globalvar.ETCDIR, "ellipse.table"), "r")
+        f = open(os.path.join(globalvar.ETCDIR, "proj", "ellipse.table"), "r")
         self.ellipsoids = {}
         for line in f.readlines():
             line = line.expandtabs(1)
@@ -1902,7 +1902,7 @@ class LocationWizard(wx.Object):
         f.close()
         
         # read projection parameter description and parsing table
-        f = open(os.path.join(globalvar.ETCDIR, "proj-desc.table"), "r")
+        f = open(os.path.join(globalvar.ETCDIR, "proj", "desc.table"), "r")
         self.paramdesc = {}
         for line in f.readlines():
             line = line.strip()

+ 5 - 5
gui/wxpython/scripts/r.li.setup.py

@@ -251,10 +251,10 @@ class LocationWizard(wx.Object):
 #                                caption=_("Location wizard"))
     
     def __readData(self):
-        """!Get georeferencing information from tables in $GISBASE/etc"""
+        """!Get georeferencing information from tables in $GISBASE/etc/proj"""
 
         # read projection and parameters
-        f = open(os.path.join(globalvar.ETCDIR, "proj-parms.table"), "r")
+        f = open(os.path.join(globalvar.ETCDIR, "proj", "parms.table"), "r")
         self.projections = {}
         self.projdesc = {}
         for line in f.readlines():
@@ -276,7 +276,7 @@ class LocationWizard(wx.Object):
         f.close()
 
         # read datum definitions
-        f = open(os.path.join(globalvar.ETCDIR, "datum.table"), "r")
+        f = open(os.path.join(globalvar.ETCDIR, "proj", "datum.table"), "r")
         self.datums = {}
         paramslist = []
         for line in f.readlines():
@@ -294,7 +294,7 @@ class LocationWizard(wx.Object):
         f.close()
 
         # read ellipsiod definitions
-        f = open(os.path.join(globalvar.ETCDIR, "ellipse.table"), "r")
+        f = open(os.path.join(globalvar.ETCDIR, "proj", "ellipse.table"), "r")
         self.ellipsoids = {}
         for line in f.readlines():
             line = line.expandtabs(1)
@@ -310,7 +310,7 @@ class LocationWizard(wx.Object):
         f.close()
         
         # read projection parameter description and parsing table
-        f = open(os.path.join(globalvar.ETCDIR, "proj-desc.table"), "r")
+        f = open(os.path.join(globalvar.ETCDIR, "proj", "desc.table"), "r")
         self.paramdesc = {}
         for line in f.readlines():
             line = line.strip()

+ 4 - 4
include/gprojects.h

@@ -24,11 +24,11 @@
 #endif
 
 /* Data Files */
-#define ELLIPSOIDTABLE "/etc/ellipse.table"
-#define DATUMTABLE "/etc/datum.table"
-#define DATUMTRANSFORMTABLE "/etc/datumtransform.table"
+#define ELLIPSOIDTABLE "/etc/proj/ellipse.table"
+#define DATUMTABLE "/etc/proj/datum.table"
+#define DATUMTRANSFORMTABLE "/etc/proj/datumtransform.table"
 /* GRASS relative location of datum conversion lookup tables */
-#define GRIDDIR "/etc/nad"
+#define GRIDDIR "/etc/proj/nad"
 
 struct pj_info
 {

+ 10 - 3
lib/gis/Makefile

@@ -5,7 +5,8 @@ LIB = GIS
 EXTRA_INC = $(ZLIBINCPATH) $(PTHREADINCPATH) $(REGEXINCPATH)
 EXTRA_CFLAGS = -DGRASS_VERSION_DATE=\"'$(GRASS_VERSION_DATE)'\"
 
-DATASRC = ellipse.table ellipse.table.solar.system datum.table datumtransform.table FIPS.code state27 state83 projections
+PROJSRC = ellipse.table ellipse.table.solar.system datum.table \
+	datumtransform.table FIPS.code state27 state83 projections
 
 include $(MODULE_TOPDIR)/include/Make/Vars.make
 
@@ -14,12 +15,12 @@ MOD_OBJS := $(filter-out fmode.o,$(AUTO_OBJS))
 include $(MODULE_TOPDIR)/include/Make/Lib.make
 include $(MODULE_TOPDIR)/include/Make/Doxygen.make
 
-DATAFILES := $(patsubst %,$(ETC)/%,$(DATASRC))
+PROJFILES := $(patsubst %,$(ETC)/proj/%,$(PROJSRC))
 
 COLORSRC := $(filter-out colors/CVS,$(wildcard colors/[abcdefghijklmnopqrstuvwxyz]*))
 COLORFILES := $(patsubst colors/%,$(ETC)/colors/%,$(COLORSRC))
 
-default: lib $(FMODE_OBJ) $(DATAFILES) $(COLORFILES) $(ETC)/colors.desc 
+default: lib $(FMODE_OBJ) $(PROJFILES) $(COLORFILES) $(ETC)/colors.desc 
 
 ifdef MINGW
 $(FMODE_OBJ): $(OBJDIR)/fmode.o
@@ -32,6 +33,12 @@ $(ETC)/colors:
 $(ETC)/colors/%: colors/% | $(ETC)/colors
 	$(INSTALL_DATA) $< $@
 
+$(ETC)/proj:
+	$(MKDIR) $@
+
+$(ETC)/proj/%: % | $(ETC)/proj
+	$(INSTALL_DATA) $< $@
+
 $(ETC)/%: %
 	$(INSTALL_DATA) $< $@
 

+ 1 - 1
lib/gis/datum.c

@@ -14,7 +14,7 @@
  *
  *****************************************************************************/
 
-#define DATUMTABLE "/etc/datum.table"
+#define DATUMTABLE "/etc/proj/datum.table"
 
 #include <unistd.h>
 #include <string.h>

+ 1 - 1
lib/gis/datumtransform.table

@@ -19,7 +19,7 @@
 # ellipsoid.
 #
 # Any supplementary files needed by the PROJ.4 library (e.g. gridshift tables) 
-# should be placed in the directory $GISBASE/etc/nad/.
+# should be placed in the directory $GISBASE/etc/proj/nad/.
 #
 # http://www.osni.gov.uk/downloads/Making%20maps%20GPS%20compatible.pdf
 ire65	"towgs84=482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15" "Ireland (North & South)"	"OSi/OSNI Helmert Transformation, Accuracy 0.4m"

+ 1 - 1
lib/gis/get_ellipse.c

@@ -256,7 +256,7 @@ int G_read_ellipsoid_table(int fatal)
     if (G_is_initialized(&table.initialized))
 	return 1;
 
-    sprintf(file, "%s/etc/ellipse.table", G_gisbase());
+    sprintf(file, "%s/etc/proj/ellipse.table", G_gisbase());
     fd = fopen(file, "r");
 
     if (fd == NULL) {

+ 13 - 9
lib/proj/Makefile

@@ -18,18 +18,19 @@ NT_TABLES = ntv1_can.dat nzgd2kgrid0005.gsb
 
 CSV_FILES := $(wildcard *.csv)
 
-NAD_DIR = $(ETC)/nad
-CSV_DIR = $(ETC)/ogr_csv
+PROJ_DIR = $(ETC)/proj
+NAD_DIR  = $(ETC)/proj/nad
+CSV_DIR  = $(ETC)/proj/ogr_csv
 
 NAD_DSTFILES := $(patsubst %.lla,$(NAD_DIR)/%,$(NAD_TABLES))
 NT_DSTFILES  := $(patsubst %,$(NAD_DIR)/%,$(NT_TABLES))
 CSV_DSTFILES := $(patsubst %,$(CSV_DIR)/%,$(CSV_FILES))
 
-NAD_SRCDIR = $(ETC)/nad/src
+NAD_SRCDIR = $(ETC)/proj/nad/src
 NAD_SRCFILES := $(patsubst %.lla,$(NAD_SRCDIR)/%.lla,$(NAD_TABLES))
 
-PROJ_TABLES := proj-desc.table proj-parms.table proj-units.table
-PROJ_DSTFILES := $(patsubst %,$(ETC)/%,$(PROJ_TABLES))
+PROJ_TABLES := desc.table parms.table units.table
+PROJ_DSTFILES := $(patsubst %,$(PROJ_DIR)/%,$(PROJ_TABLES))
 
 default: lib $(FTOL_OBJ)
 	$(MAKE) $(NAD_DSTFILES) $(CSV_DSTFILES) $(PROJ_DSTFILES) $(NAD_SRCFILES)
@@ -51,16 +52,19 @@ $(CSV_DSTFILES): $(CSV_DIR)/%.csv: %.csv | $(CSV_DIR)
 $(NAD_SRCFILES): $(NAD_SRCDIR)/%.lla: %.lla | $(NAD_SRCDIR)
 	$(INSTALL_DATA) $< $@
 
-$(ETC)/proj-%.table: proj-%.table
+$(PROJ_DSTFILES): $(PROJ_DIR)/%: % | $(PROJ_DIR)
 	$(INSTALL_DATA) $< $@
 
-$(NAD_DIR):
+$(PROJ_DIR):
 	$(MKDIR) $@
 
-$(CSV_DIR):
+$(NAD_DIR): | $(PROJ_DIR)
 	$(MKDIR) $@
 
-$(NAD_SRCDIR):
+$(CSV_DIR): | $(PROJ_DIR)
+	$(MKDIR) $@
+
+$(NAD_SRCDIR): | $(PROJ_DIR)
 	$(MKDIR) $@
 
 # Note for future improvement:

+ 2 - 2
lib/proj/convert.c

@@ -27,7 +27,7 @@
 #include "local_proto.h"
 
 /* GRASS relative location of OGR co-ordinate system lookup tables */
-#define CSVDIR "/etc/ogr_csv"
+#define CSVDIR "/etc/proj/ogr_csv"
 
 static void DatumNameMassage(char **);
 
@@ -384,7 +384,7 @@ int GPJ_osr_to_grass(struct Cell_head *cellhd, struct Key_Value **projinfo,
 	char path[4095];
 	char name[80];
 
-	sprintf(path, "%s/etc/projections", G_gisbase());
+	sprintf(path, "%s/etc/proj/projections", G_gisbase());
 	if (G_lookup_key_value_from_file(path, pszProj, name, sizeof(name)) >
 	    0)
 	    G_set_key_value("name", name, *projinfo);

lib/proj/proj-desc.table → lib/proj/desc.table


lib/proj/proj-parms.table → lib/proj/parms.table


+ 1 - 1
lib/proj/projlib.dox

@@ -47,7 +47,7 @@ and grid).
 
 If a warning appears that a certain datum is not recognised by GRASS and
 no parameters found, the datum transformation parameters have to be
-added to $GISBASE/etc/datum.table (and also $GISBASE/etc/datumtransform.table
+added to $GISBASE/etc/proj/datum.table (and also $GISBASE/etc/proj/datumtransform.table
 if you have 7-parameter transformation parameters). No need to re-compile
 though. When adding to SVN, currently these files are still in lib/gis/. 
 

lib/proj/proj-units.table → lib/proj/units.table