???shapefile???С??Χ???ε?c++????
???????????? ???????[ 2014/2/28 9:35:56 ] ????????c++ shapefile
??????????????shapefile???С??Χ?е?c++??????????????????shapefile?????????????ζ???????????????.dbf?? .exe?? .png????????????????λ?????????????????????????????????????????????????????????????
???????shapefile?洢????????????Ρ?ESRI shapfile???????3 ???????????shp?? .shx ??.dbf??????????????м??????ε?С??Χ???????????shp??????????ο?ESRI Shapefile?????????? .shp ??3???????????????????????????????????????????С??Χ?е?????????????C++??????????????????????????
#include <iostream>
#include <stdio.h>
#include <conio.h>
#include <cstdint>
using namespace std;
class ByteConverter
{
public:
//??BigEndian????洢??32??λ???????????????λ???????????????磺??????λ?????
static int32_t bigEndianIntRead(char *fileBuf?? int startIndex)
{
return (((fileBuf[startIndex+0]&0xff)<<24)|
((fileBuf[startIndex+1]&0xff)<<16)|
((fileBuf[startIndex+2]&0xff)<<8)|
((fileBuf[startIndex+3]&0xff)));
}
// ??BigEndian????洢??32λ????????????
static int32_t littleEndianIntRead(char *fileBuf?? int startIndex)
{
return (((fileBuf[startIndex+3]&0xff)<<24)|
((fileBuf[startIndex+2]&0xff)<<16)|
((fileBuf[startIndex+1]&0xff)<<8)|
((fileBuf[startIndex+0]&0xff)));
}
// ??BigEndian????洢??64λ??8?????????????
static double littleEndianDoubleRead(char *fileBuf?? int startIndex)
{
double convert;
char *add;
int j;
add = new char();
j=-1;
for (int i=startIndex; i<startIndex+8; i++)
{
j++;
add[j] = fileBuf[i];
}
convert = *reinterpret_cast<double *const>(add);
return convert;
}
};
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11