6 enum isea_poly { ISEA_NONE, ISEA_ICOSAHEDRON = 20 };
7 enum isea_topology { ISEA_HEXAGON=6, ISEA_TRIANGLE=3, ISEA_DIAMOND=4 };
8 enum isea_address_form { ISEA_GEO, ISEA_Q2DI, ISEA_SEQNUM, ISEA_INTERLEAVE,
9 ISEA_PLANE, ISEA_Q2DD, ISEA_PROJTRI, ISEA_VERTEX2DD, ISEA_HEX
12 /* TODO calculate this */
13 #define ISEA_SCALE 0.8301572857837594396028083
16 int polyhedron; /* ignored, icosahedron */
17 double o_lat, o_lon, o_az; /* orientation, radians */
18 int pole; /* true if standard snyder */
19 int topology; /* ignored, hexagon */
20 int aperture; /* valid values depend on partitioning method */
22 double radius; /* radius of the earth in meters, ignored 1.0 */
23 int output; /* an isea_address_form */
24 int triangle; /* triangle of last transformed point */
25 int quad; /* quad of last transformed point */
37 extern struct isea_dgg isea_standard_dgg;
40 int type; /* enum isea_address_form */
42 double x,y; /* or i,j or lon,lat depending on type */
47 unsigned validity; /* which are good */
55 struct point triangle_xy;
60 /* set the orientation */
61 int isea_orient(struct isea_dgg *dgg, double lon, double lat, double az);
62 int isea_orient_isea(struct isea_dgg *d);
63 int isea_orient_pole(struct isea_dgg *d);
64 int isea_orient_dymax(struct isea_dgg *d);
66 /* set a clip region */
67 int isea_region(struct isea_dgg *dgg, double lon, double lat);
70 int isea_valid(struct isea_dgg *dgg);
72 /* set the resolution by picking the nearest area */
73 int isea_resolution_area(struct isea_dgg *dgg, double area);
75 /* the characteristic length scale */
76 double isea_cell_cls(struct isea_dgg *dgg);
78 /* intercell distance as projected */
79 double isea_cell_width(struct isea_dgg *dgg);
81 double isea_cell_area(struct isea_dgg *dgg);
83 /* total number of cells */
84 double isea_cell_count(struct isea_dgg *dgg);
86 /* set the resolution by picking the nearest intercell distance */
87 int isea_resolution_distance(struct isea_dgg *dgg, double distance);
89 /* grid size in cells */
90 int isea_grid_size(struct isea_dgg *dgg);
92 int isea_grid_init(struct isea_dgg *d);
95 struct isea_dgg *isea_grid_standard(void);
97 /* coordinate projection */
99 /* returns triangle, out may be null */
100 int isea_transform(struct isea_dgg *dgg, struct isea_geo *in,
101 struct isea_pt *out);
103 struct isea_pt isea_forward(struct isea_dgg *g, struct isea_geo *in);
106 int isea_readdress(struct isea_dgg *dgg, int input, struct isea_pt *in,
107 int output, struct isea_pt *out);
109 struct isea_pt isea_triangle_xy(int triangle);
110 int isea_xy_triangle(struct isea_pt *p, double radius);
114 * the idea is that if you have a cartesian coordinate, and just want
115 * to change the resolution, it's just a re-bin, not a new
118 int isea_tranform_grid(void);
120 /* grid generation */
122 /* address conversion */
123 void isea_rotate(struct isea_pt *pt, double degrees);
124 int isea_dddi(struct isea_dgg *g, int quad, struct isea_pt *pt, struct isea_pt *di);
125 int isea_ptdd(int triangle, struct isea_pt *pt);
126 int isea_ptdi(struct isea_dgg *g, int tri, struct isea_pt *pt, struct isea_pt *di);
127 int isea_hex(struct isea_dgg *g, int tri, struct isea_pt *pt, struct isea_pt *di);
128 int isea_disn(struct isea_dgg *g, int quad, struct isea_pt *h);
130 /* binning point values */
132 /* presence/absence binning */
133 int isea_snyder_forward(struct isea_geo *ll, struct isea_pt *out);