00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include <grass/Vect.h>
00019 #include <grass/gis.h>
00020
00021
00022
00023
00024
00025
00026
00027
00028
00036 int
00037 Vect_set_constraint_region ( struct Map_info *Map,
00038 double n, double s, double e, double w, double t, double b )
00039 {
00040 if (n <= s)
00041 return (-1);
00042 if (e <= w)
00043 return (-1);
00044
00045 Map->Constraint_region_flag = 1;
00046 Map->Constraint_N = n;
00047 Map->Constraint_S = s;
00048 Map->Constraint_E = e;
00049 Map->Constraint_W = w;
00050 Map->Constraint_T = t;
00051 Map->Constraint_B = b;
00052 Map->proj = G_projection ();
00053
00054 return (0);
00055 }
00056
00064 int
00065 Vect_get_constraint_box ( struct Map_info *Map, BOUND_BOX *Box )
00066 {
00067 Box->N = Map->Constraint_N;
00068 Box->S = Map->Constraint_S;
00069 Box->E = Map->Constraint_E;
00070 Box->W = Map->Constraint_W;
00071 Box->T = Map->Constraint_T;
00072 Box->B = Map->Constraint_B;
00073
00074 return 0;
00075 }
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00099 int
00100 Vect_set_constraint_type (
00101 struct Map_info *Map,
00102 int type)
00103 {
00104 Map->Constraint_type = type;
00105 Map->Constraint_type_flag = 1;
00106
00107 return 0;
00108 }
00109
00116 int
00117 Vect_remove_constraints (struct Map_info *Map)
00118 {
00119 Map->Constraint_region_flag = 0;
00120 Map->Constraint_type_flag = 0;
00121
00122 return 0;
00123 }