Revision 3034
Added by perry over 17 years ago
metacat_shapefile.cpp | ||
---|---|---|
29 | 29 |
#include <stdlib.h> |
30 | 30 |
#include <string.h> |
31 | 31 |
#include <math.h> |
32 |
#include "iostream.h"
|
|
32 |
#include "iostream" |
|
33 | 33 |
#include <fstream> |
34 | 34 |
#include <string> |
35 | 35 |
#include <vector> |
... | ... | |
117 | 117 |
hSHPHandle = SHPCreate( pszFilename, nSHPType ); |
118 | 118 |
|
119 | 119 |
ii = 0; |
120 |
for ( ii = 0; ii < number_data_lines; ii++ ) |
|
120 |
for ( ii = 0; ii < number_data_lines_x; ii++ )
|
|
121 | 121 |
{ |
122 | 122 |
double area_coef = sqrt( pow((max_pntx[2][ii]-min_pntx[2][ii]),2) + pow((max_pnty[2][ii]-min_pnty[2][ii]),2) ); |
123 | 123 |
double ave_x = ( (min_pntx[2][ii]+max_pntx[2][ii])/2 ); |
124 | 124 |
double ave_y = ( (min_pnty[2][ii]+max_pnty[2][ii])/2 ); |
125 | 125 |
double ave_z = ( pointz[2][ii] ); |
126 | 126 |
|
127 |
cout << "area coef: " << area_coef << endl; |
|
128 |
|
|
127 | 129 |
if (ave_x < 180 && ave_x > -180 && ave_y < 90 && ave_y >-90 ) { |
128 | 130 |
|
129 | 131 |
psShape = SHPCreateObject( SHPT_POINT, ii, 0, NULL, NULL, 1, &ave_x, &ave_y, &ave_z, NULL ); |
... | ... | |
132 | 134 |
SHPDestroyObject( psShape ); |
133 | 135 |
//do the update to the dbf file too |
134 | 136 |
iRecord = DBFGetRecordCount( hDBF ); |
135 |
|
|
137 |
|
|
136 | 138 |
DBFWriteStringAttribute(hDBF, iRecord, url_field, urlvec[ii].c_str() ); |
137 | 139 |
DBFWriteStringAttribute(hDBF, iRecord, docid_field, docidvec[ii].c_str() ); |
138 | 140 |
DBFWriteIntegerAttribute(hDBF, iRecord, id_field, int(ii) ); |
Also available in: Unified diff
initial import of changes to metacat source and config files to support spatial option