Lines Matching refs:shp

417     gaiaShapefilePtr shp = malloc (sizeof (gaiaShapefile));  in gaiaAllocShapefile()  local
418 shp->endian_arch = 1; in gaiaAllocShapefile()
419 shp->Path = NULL; in gaiaAllocShapefile()
420 shp->Shape = -1; in gaiaAllocShapefile()
421 shp->EffectiveType = GAIA_UNKNOWN; in gaiaAllocShapefile()
422 shp->EffectiveDims = GAIA_XY; in gaiaAllocShapefile()
423 shp->flShp = NULL; in gaiaAllocShapefile()
424 shp->flShx = NULL; in gaiaAllocShapefile()
425 shp->flDbf = NULL; in gaiaAllocShapefile()
426 shp->memShp = NULL; in gaiaAllocShapefile()
427 shp->memShx = NULL; in gaiaAllocShapefile()
428 shp->memDbf = NULL; in gaiaAllocShapefile()
429 shp->Dbf = NULL; in gaiaAllocShapefile()
430 shp->BufShp = NULL; in gaiaAllocShapefile()
431 shp->ShpBfsz = 0; in gaiaAllocShapefile()
432 shp->BufDbf = NULL; in gaiaAllocShapefile()
433 shp->DbfHdsz = 0; in gaiaAllocShapefile()
434 shp->DbfReclen = 0; in gaiaAllocShapefile()
435 shp->DbfSize = 0; in gaiaAllocShapefile()
436 shp->DbfRecno = 0; in gaiaAllocShapefile()
437 shp->ShpSize = 0; in gaiaAllocShapefile()
438 shp->ShxSize = 0; in gaiaAllocShapefile()
439 shp->MinX = DBL_MAX; in gaiaAllocShapefile()
440 shp->MinY = DBL_MAX; in gaiaAllocShapefile()
441 shp->MaxX = -DBL_MAX; in gaiaAllocShapefile()
442 shp->MaxY = -DBL_MAX; in gaiaAllocShapefile()
443 shp->Valid = 0; in gaiaAllocShapefile()
444 shp->IconvObj = NULL; in gaiaAllocShapefile()
445 shp->LastError = NULL; in gaiaAllocShapefile()
446 return shp; in gaiaAllocShapefile()
450 gaiaFreeShapefile (gaiaShapefilePtr shp) in gaiaFreeShapefile() argument
453 if (shp->Path) in gaiaFreeShapefile()
454 free (shp->Path); in gaiaFreeShapefile()
455 if (shp->flShp) in gaiaFreeShapefile()
456 fclose (shp->flShp); in gaiaFreeShapefile()
457 if (shp->flShx) in gaiaFreeShapefile()
458 fclose (shp->flShx); in gaiaFreeShapefile()
459 if (shp->flDbf) in gaiaFreeShapefile()
460 fclose (shp->flDbf); in gaiaFreeShapefile()
461 if (shp->Dbf) in gaiaFreeShapefile()
462 gaiaFreeDbfList (shp->Dbf); in gaiaFreeShapefile()
463 if (shp->BufShp) in gaiaFreeShapefile()
464 free (shp->BufShp); in gaiaFreeShapefile()
465 if (shp->BufDbf) in gaiaFreeShapefile()
466 free (shp->BufDbf); in gaiaFreeShapefile()
467 if (shp->IconvObj) in gaiaFreeShapefile()
468 iconv_close ((iconv_t) shp->IconvObj); in gaiaFreeShapefile()
469 if (shp->LastError) in gaiaFreeShapefile()
470 free (shp->LastError); in gaiaFreeShapefile()
471 free (shp); in gaiaFreeShapefile()
475 gaiaOpenShpRead (gaiaShapefilePtr shp, const char *path, const char *charFrom, in gaiaOpenShpRead() argument
517 shp->IconvObj = iconv_ret; in gaiaOpenShpRead()
524 if (shp->flShp != NULL || shp->flShx != NULL || shp->flDbf != NULL) in gaiaOpenShpRead()
530 if (shp->memShx == NULL) in gaiaOpenShpRead()
546 if (shp->memShp == NULL) in gaiaOpenShpRead()
562 if (shp->memDbf == NULL) in gaiaOpenShpRead()
579 if (shp->memShx != NULL) in gaiaOpenShpRead()
580 rd = gaiaMemRead (buf_shx, 100, shp->memShx); in gaiaOpenShpRead()
589 if (shp->memShp != NULL) in gaiaOpenShpRead()
590 rd = gaiaMemRead (buf_shp, 100, shp->memShp); in gaiaOpenShpRead()
607 shp->MinX = gaiaImport64 (buf_shp + 36, GAIA_LITTLE_ENDIAN, endian_arch); in gaiaOpenShpRead()
608 shp->MinY = gaiaImport64 (buf_shp + 44, GAIA_LITTLE_ENDIAN, endian_arch); in gaiaOpenShpRead()
609 shp->MaxX = gaiaImport64 (buf_shp + 52, GAIA_LITTLE_ENDIAN, endian_arch); in gaiaOpenShpRead()
610 shp->MaxY = gaiaImport64 (buf_shp + 60, GAIA_LITTLE_ENDIAN, endian_arch); in gaiaOpenShpRead()
612 if (shp->memDbf != NULL) in gaiaOpenShpRead()
613 rd = gaiaMemRead (bf, 32, shp->memDbf); in gaiaOpenShpRead()
665 if (shp->memDbf != NULL) in gaiaOpenShpRead()
666 rd = gaiaMemRead (bf, extra, shp->memDbf); in gaiaOpenShpRead()
674 if (shp->memDbf != NULL) in gaiaOpenShpRead()
675 rd = gaiaMemRead (bf, 32, shp->memDbf); in gaiaOpenShpRead()
698 ((iconv_t) (shp->IconvObj), &pBuf, &len, &pUtf8buf, in gaiaOpenShpRead()
718 shp->Path = malloc (len + 1); in gaiaOpenShpRead()
719 strcpy (shp->Path, path); in gaiaOpenShpRead()
720 shp->ReadOnly = 1; in gaiaOpenShpRead()
721 shp->Shape = shape; in gaiaOpenShpRead()
728 shp->EffectiveType = GAIA_POINT; in gaiaOpenShpRead()
733 shp->EffectiveType = GAIA_MULTILINESTRING; in gaiaOpenShpRead()
738 shp->EffectiveType = GAIA_MULTIPOLYGON; in gaiaOpenShpRead()
743 shp->EffectiveType = GAIA_MULTIPOINT; in gaiaOpenShpRead()
753 shp->EffectiveDims = GAIA_XY_Z_M; in gaiaOpenShpRead()
759 shp->EffectiveDims = GAIA_XY_M; in gaiaOpenShpRead()
762 shp->EffectiveDims = GAIA_XY; in gaiaOpenShpRead()
765 shp->flShp = fl_shp; in gaiaOpenShpRead()
766 shp->flShx = fl_shx; in gaiaOpenShpRead()
767 shp->flDbf = fl_dbf; in gaiaOpenShpRead()
768 shp->Dbf = dbf_list; in gaiaOpenShpRead()
770 shp->BufShp = buf_shp; in gaiaOpenShpRead()
771 shp->ShpBfsz = buf_size; in gaiaOpenShpRead()
773 shp->BufDbf = malloc (sizeof (unsigned char) * dbf_reclen); in gaiaOpenShpRead()
774 shp->DbfHdsz = dbf_size + 1; in gaiaOpenShpRead()
775 shp->DbfReclen = dbf_reclen; in gaiaOpenShpRead()
776 shp->Valid = 1; in gaiaOpenShpRead()
777 shp->endian_arch = endian_arch; in gaiaOpenShpRead()
781 if (shp->LastError) in gaiaOpenShpRead()
782 free (shp->LastError); in gaiaOpenShpRead()
784 shp->LastError = malloc (len + 1); in gaiaOpenShpRead()
785 strcpy (shp->LastError, errMsg); in gaiaOpenShpRead()
789 if (shp->LastError) in gaiaOpenShpRead()
790 free (shp->LastError); in gaiaOpenShpRead()
792 shp->LastError = malloc (len + 1); in gaiaOpenShpRead()
793 strcpy (shp->LastError, errMsg); in gaiaOpenShpRead()
803 if (shp->LastError) in gaiaOpenShpRead()
804 free (shp->LastError); in gaiaOpenShpRead()
806 shp->LastError = malloc (len + 1); in gaiaOpenShpRead()
807 strcpy (shp->LastError, errMsg); in gaiaOpenShpRead()
817 if (shp->LastError) in gaiaOpenShpRead()
818 free (shp->LastError); in gaiaOpenShpRead()
821 shp->LastError = malloc (len + 1); in gaiaOpenShpRead()
822 strcpy (shp->LastError, errMsg); in gaiaOpenShpRead()
832 if (shp->LastError) in gaiaOpenShpRead()
833 free (shp->LastError); in gaiaOpenShpRead()
836 shp->LastError = malloc (len + 1); in gaiaOpenShpRead()
837 strcpy (shp->LastError, errMsg); in gaiaOpenShpRead()
848 if (shp->LastError) in gaiaOpenShpRead()
849 free (shp->LastError); in gaiaOpenShpRead()
852 shp->LastError = malloc (len + 1); in gaiaOpenShpRead()
853 strcpy (shp->LastError, errMsg); in gaiaOpenShpRead()
864 if (shp->LastError) in gaiaOpenShpRead()
865 free (shp->LastError); in gaiaOpenShpRead()
868 shp->LastError = malloc (len + 1); in gaiaOpenShpRead()
869 strcpy (shp->LastError, errMsg); in gaiaOpenShpRead()
1037 gaiaOpenShpWrite (gaiaShapefilePtr shp, const char *path, int shape, in gaiaOpenShpWrite() argument
1042 gaiaOpenShpWriteEx (shp, path, shape, dbf_list, charFrom, charTo, in gaiaOpenShpWrite()
1047 gaiaOpenShpWriteEx (gaiaShapefilePtr shp, const char *path, int shape, in gaiaOpenShpWriteEx() argument
1089 shp->IconvObj = iconv_ret; in gaiaOpenShpWriteEx()
1096 if (shp->flShp != NULL || shp->flShx != NULL || shp->flDbf != NULL) in gaiaOpenShpWriteEx()
1182 ((iconv_t) (shp->IconvObj), &pBuf, &len, &pUtf8buf, in gaiaOpenShpWriteEx()
1206 shp->Path = malloc (len + 1); in gaiaOpenShpWriteEx()
1207 strcpy (shp->Path, path); in gaiaOpenShpWriteEx()
1208 shp->ReadOnly = 0; in gaiaOpenShpWriteEx()
1213 shp->Shape = GAIA_SHP_POINT; in gaiaOpenShpWriteEx()
1214 shp->EffectiveType = GAIA_POINT; in gaiaOpenShpWriteEx()
1215 shp->EffectiveDims = GAIA_XY; in gaiaOpenShpWriteEx()
1218 shp->Shape = GAIA_SHP_POINTZ; in gaiaOpenShpWriteEx()
1219 shp->EffectiveType = GAIA_POINT; in gaiaOpenShpWriteEx()
1220 shp->EffectiveDims = GAIA_XY_Z; in gaiaOpenShpWriteEx()
1223 shp->Shape = GAIA_SHP_POINTM; in gaiaOpenShpWriteEx()
1224 shp->EffectiveType = GAIA_POINT; in gaiaOpenShpWriteEx()
1225 shp->EffectiveDims = GAIA_XY_M; in gaiaOpenShpWriteEx()
1228 shp->Shape = GAIA_SHP_POINTZ; in gaiaOpenShpWriteEx()
1229 shp->EffectiveType = GAIA_POINT; in gaiaOpenShpWriteEx()
1230 shp->EffectiveDims = GAIA_XY_Z_M; in gaiaOpenShpWriteEx()
1233 shp->Shape = GAIA_SHP_MULTIPOINT; in gaiaOpenShpWriteEx()
1234 shp->EffectiveType = GAIA_MULTIPOINT; in gaiaOpenShpWriteEx()
1235 shp->EffectiveDims = GAIA_XY; in gaiaOpenShpWriteEx()
1238 shp->Shape = GAIA_SHP_MULTIPOINTZ; in gaiaOpenShpWriteEx()
1239 shp->EffectiveType = GAIA_MULTIPOINT; in gaiaOpenShpWriteEx()
1240 shp->EffectiveDims = GAIA_XY_Z; in gaiaOpenShpWriteEx()
1243 shp->Shape = GAIA_SHP_MULTIPOINTM; in gaiaOpenShpWriteEx()
1244 shp->EffectiveType = GAIA_MULTIPOINT; in gaiaOpenShpWriteEx()
1245 shp->EffectiveDims = GAIA_XY_M; in gaiaOpenShpWriteEx()
1248 shp->Shape = GAIA_SHP_MULTIPOINTZ; in gaiaOpenShpWriteEx()
1249 shp->EffectiveType = GAIA_MULTIPOINT; in gaiaOpenShpWriteEx()
1250 shp->EffectiveDims = GAIA_XY_Z_M; in gaiaOpenShpWriteEx()
1253 shp->Shape = GAIA_SHP_POLYLINE; in gaiaOpenShpWriteEx()
1254 shp->EffectiveType = GAIA_LINESTRING; in gaiaOpenShpWriteEx()
1255 shp->EffectiveDims = GAIA_XY; in gaiaOpenShpWriteEx()
1258 shp->Shape = GAIA_SHP_POLYLINEZ; in gaiaOpenShpWriteEx()
1259 shp->EffectiveType = GAIA_LINESTRING; in gaiaOpenShpWriteEx()
1260 shp->EffectiveDims = GAIA_XY_Z; in gaiaOpenShpWriteEx()
1263 shp->Shape = GAIA_SHP_POLYLINEM; in gaiaOpenShpWriteEx()
1264 shp->EffectiveType = GAIA_LINESTRING; in gaiaOpenShpWriteEx()
1265 shp->EffectiveDims = GAIA_XY_M; in gaiaOpenShpWriteEx()
1268 shp->Shape = GAIA_SHP_POLYLINEZ; in gaiaOpenShpWriteEx()
1269 shp->EffectiveType = GAIA_LINESTRING; in gaiaOpenShpWriteEx()
1270 shp->EffectiveDims = GAIA_XY_Z_M; in gaiaOpenShpWriteEx()
1273 shp->Shape = GAIA_SHP_POLYLINE; in gaiaOpenShpWriteEx()
1274 shp->EffectiveType = GAIA_MULTILINESTRING; in gaiaOpenShpWriteEx()
1275 shp->EffectiveDims = GAIA_XY; in gaiaOpenShpWriteEx()
1278 shp->Shape = GAIA_SHP_POLYLINEZ; in gaiaOpenShpWriteEx()
1279 shp->EffectiveType = GAIA_MULTILINESTRING; in gaiaOpenShpWriteEx()
1280 shp->EffectiveDims = GAIA_XY_Z; in gaiaOpenShpWriteEx()
1283 shp->Shape = GAIA_SHP_POLYLINEM; in gaiaOpenShpWriteEx()
1284 shp->EffectiveType = GAIA_MULTILINESTRING; in gaiaOpenShpWriteEx()
1285 shp->EffectiveDims = GAIA_XY_M; in gaiaOpenShpWriteEx()
1288 shp->Shape = GAIA_SHP_POLYLINEZ; in gaiaOpenShpWriteEx()
1289 shp->EffectiveType = GAIA_MULTILINESTRING; in gaiaOpenShpWriteEx()
1290 shp->EffectiveDims = GAIA_XY_Z_M; in gaiaOpenShpWriteEx()
1293 shp->Shape = GAIA_SHP_POLYGON; in gaiaOpenShpWriteEx()
1294 shp->EffectiveType = GAIA_POLYGON; in gaiaOpenShpWriteEx()
1295 shp->EffectiveDims = GAIA_XY; in gaiaOpenShpWriteEx()
1298 shp->Shape = GAIA_SHP_POLYGONZ; in gaiaOpenShpWriteEx()
1299 shp->EffectiveType = GAIA_POLYGON; in gaiaOpenShpWriteEx()
1300 shp->EffectiveDims = GAIA_XY_Z; in gaiaOpenShpWriteEx()
1303 shp->Shape = GAIA_SHP_POLYGONM; in gaiaOpenShpWriteEx()
1304 shp->EffectiveType = GAIA_POLYGON; in gaiaOpenShpWriteEx()
1305 shp->EffectiveDims = GAIA_XY_M; in gaiaOpenShpWriteEx()
1308 shp->Shape = GAIA_SHP_POLYGONZ; in gaiaOpenShpWriteEx()
1309 shp->EffectiveType = GAIA_POLYGON; in gaiaOpenShpWriteEx()
1310 shp->EffectiveDims = GAIA_XY_Z_M; in gaiaOpenShpWriteEx()
1313 shp->Shape = GAIA_SHP_POLYGON; in gaiaOpenShpWriteEx()
1314 shp->EffectiveType = GAIA_MULTIPOLYGON; in gaiaOpenShpWriteEx()
1315 shp->EffectiveDims = GAIA_XY; in gaiaOpenShpWriteEx()
1318 shp->Shape = GAIA_SHP_POLYGONZ; in gaiaOpenShpWriteEx()
1319 shp->EffectiveType = GAIA_MULTIPOLYGON; in gaiaOpenShpWriteEx()
1320 shp->EffectiveDims = GAIA_XY_Z; in gaiaOpenShpWriteEx()
1323 shp->Shape = GAIA_SHP_POLYGONM; in gaiaOpenShpWriteEx()
1324 shp->EffectiveType = GAIA_MULTIPOLYGON; in gaiaOpenShpWriteEx()
1325 shp->EffectiveDims = GAIA_XY_M; in gaiaOpenShpWriteEx()
1328 shp->Shape = GAIA_SHP_POLYGONZ; in gaiaOpenShpWriteEx()
1329 shp->EffectiveType = GAIA_MULTIPOLYGON; in gaiaOpenShpWriteEx()
1330 shp->EffectiveDims = GAIA_XY_Z_M; in gaiaOpenShpWriteEx()
1333 shp->flShp = fl_shp; in gaiaOpenShpWriteEx()
1334 shp->flShx = fl_shx; in gaiaOpenShpWriteEx()
1335 shp->flDbf = fl_dbf; in gaiaOpenShpWriteEx()
1336 shp->Dbf = dbf_list; in gaiaOpenShpWriteEx()
1337 shp->BufShp = buf_shp; in gaiaOpenShpWriteEx()
1338 shp->ShpBfsz = buf_size; in gaiaOpenShpWriteEx()
1339 shp->BufDbf = dbf_buf; in gaiaOpenShpWriteEx()
1340 shp->DbfHdsz = dbf_size + 1; in gaiaOpenShpWriteEx()
1341 shp->DbfReclen = dbf_reclen; in gaiaOpenShpWriteEx()
1342 shp->DbfSize = dbf_size; in gaiaOpenShpWriteEx()
1343 shp->DbfRecno = 0; in gaiaOpenShpWriteEx()
1344 shp->ShpSize = shp_size; in gaiaOpenShpWriteEx()
1345 shp->ShxSize = shx_size; in gaiaOpenShpWriteEx()
1346 shp->MinX = DBL_MAX; in gaiaOpenShpWriteEx()
1347 shp->MinY = DBL_MAX; in gaiaOpenShpWriteEx()
1348 shp->MaxX = -DBL_MAX; in gaiaOpenShpWriteEx()
1349 shp->MaxY = -DBL_MAX; in gaiaOpenShpWriteEx()
1350 shp->Valid = 1; in gaiaOpenShpWriteEx()
1351 shp->endian_arch = endian_arch; in gaiaOpenShpWriteEx()
1355 if (shp->LastError) in gaiaOpenShpWriteEx()
1356 free (shp->LastError); in gaiaOpenShpWriteEx()
1358 shp->LastError = malloc (len + 1); in gaiaOpenShpWriteEx()
1359 strcpy (shp->LastError, errMsg); in gaiaOpenShpWriteEx()
1363 if (shp->LastError) in gaiaOpenShpWriteEx()
1364 free (shp->LastError); in gaiaOpenShpWriteEx()
1366 shp->LastError = malloc (len + 1); in gaiaOpenShpWriteEx()
1367 strcpy (shp->LastError, errMsg); in gaiaOpenShpWriteEx()
1771 gaiaReadShpEntity (gaiaShapefilePtr shp, int current_row, int srid) in gaiaReadShpEntity() argument
1773 return gaiaReadShpEntity_ex (shp, current_row, srid, 0); in gaiaReadShpEntity()
1777 gaiaReadShpEntity_ex (gaiaShapefilePtr shp, int current_row, int srid, in gaiaReadShpEntity_ex() argument
1817 if (shp->memShx != NULL) in gaiaReadShpEntity_ex()
1818 skpos = gaiaMemFseek (shp->memShx, offset); in gaiaReadShpEntity_ex()
1820 skpos = gaia_fseek (shp->flShx, offset, SEEK_SET); in gaiaReadShpEntity_ex()
1823 if (shp->memDbf != NULL) in gaiaReadShpEntity_ex()
1824 rd = gaiaMemRead (buf, 8, shp->memShx); in gaiaReadShpEntity_ex()
1826 rd = fread (buf, sizeof (unsigned char), 8, shp->flShx); in gaiaReadShpEntity_ex()
1829 off_shp = gaiaImport32 (buf, GAIA_BIG_ENDIAN, shp->endian_arch); in gaiaReadShpEntity_ex()
1832 shp->DbfHdsz + in gaiaReadShpEntity_ex()
1833 ((gaia_off_t) current_row * (gaia_off_t) (shp->DbfReclen)); in gaiaReadShpEntity_ex()
1834 if (shp->memDbf != NULL) in gaiaReadShpEntity_ex()
1835 skpos = gaiaMemFseek (shp->memDbf, offset); in gaiaReadShpEntity_ex()
1837 skpos = gaia_fseek (shp->flDbf, offset, SEEK_SET); in gaiaReadShpEntity_ex()
1840 if (shp->memDbf != NULL) in gaiaReadShpEntity_ex()
1841 rd = gaiaMemRead (shp->BufDbf, shp->DbfReclen, shp->memDbf); in gaiaReadShpEntity_ex()
1843 rd = fread (shp->BufDbf, sizeof (unsigned char), shp->DbfReclen, in gaiaReadShpEntity_ex()
1844 shp->flDbf); in gaiaReadShpEntity_ex()
1845 if (rd != shp->DbfReclen) in gaiaReadShpEntity_ex()
1847 if (*(shp->BufDbf) == '*') in gaiaReadShpEntity_ex()
1851 if (shp->memShp != NULL) in gaiaReadShpEntity_ex()
1852 skpos = gaiaMemFseek (shp->memShp, offset); in gaiaReadShpEntity_ex()
1854 skpos = gaia_fseek (shp->flShp, offset, SEEK_SET); in gaiaReadShpEntity_ex()
1857 if (shp->memShp != NULL) in gaiaReadShpEntity_ex()
1858 rd = gaiaMemRead (buf, 12, shp->memShp); in gaiaReadShpEntity_ex()
1860 rd = fread (buf, sizeof (unsigned char), 12, shp->flShp); in gaiaReadShpEntity_ex()
1863 sz = gaiaImport32 (buf + 4, GAIA_BIG_ENDIAN, shp->endian_arch); in gaiaReadShpEntity_ex()
1864 shape = gaiaImport32 (buf + 8, GAIA_LITTLE_ENDIAN, shp->endian_arch); in gaiaReadShpEntity_ex()
1870 else if (shape != shp->Shape) in gaiaReadShpEntity_ex()
1872 if ((sz * 2) > shp->ShpBfsz) in gaiaReadShpEntity_ex()
1875 free (shp->BufShp); in gaiaReadShpEntity_ex()
1876 shp->ShpBfsz = sz * 2; in gaiaReadShpEntity_ex()
1877 shp->BufShp = malloc (sizeof (unsigned char) * shp->ShpBfsz); in gaiaReadShpEntity_ex()
1882 if (shp->memShp != NULL) in gaiaReadShpEntity_ex()
1883 rd = gaiaMemRead (shp->BufShp, 16, shp->memShp); in gaiaReadShpEntity_ex()
1885 rd = fread (shp->BufShp, sizeof (unsigned char), 16, shp->flShp); in gaiaReadShpEntity_ex()
1888 x = gaiaImport64 (shp->BufShp, GAIA_LITTLE_ENDIAN, shp->endian_arch); in gaiaReadShpEntity_ex()
1889 y = gaiaImport64 (shp->BufShp + 8, GAIA_LITTLE_ENDIAN, in gaiaReadShpEntity_ex()
1890 shp->endian_arch); in gaiaReadShpEntity_ex()
1891 if (shp->EffectiveDims == GAIA_XY_Z) in gaiaReadShpEntity_ex()
1896 else if (shp->EffectiveDims == GAIA_XY_M) in gaiaReadShpEntity_ex()
1901 else if (shp->EffectiveDims == GAIA_XY_Z_M) in gaiaReadShpEntity_ex()
1917 if (shp->memShp != NULL) in gaiaReadShpEntity_ex()
1918 rd = gaiaMemRead (shp->BufShp, 32, shp->memShp); in gaiaReadShpEntity_ex()
1920 rd = fread (shp->BufShp, sizeof (unsigned char), 32, shp->flShp); in gaiaReadShpEntity_ex()
1927 x = gaiaImport64 (shp->BufShp, GAIA_LITTLE_ENDIAN, shp->endian_arch); in gaiaReadShpEntity_ex()
1928 y = gaiaImport64 (shp->BufShp + 8, GAIA_LITTLE_ENDIAN, in gaiaReadShpEntity_ex()
1929 shp->endian_arch); in gaiaReadShpEntity_ex()
1930 z = gaiaImport64 (shp->BufShp + 16, GAIA_LITTLE_ENDIAN, in gaiaReadShpEntity_ex()
1931 shp->endian_arch); in gaiaReadShpEntity_ex()
1935 m = gaiaImport64 (shp->BufShp + 24, GAIA_LITTLE_ENDIAN, in gaiaReadShpEntity_ex()
1936 shp->endian_arch); in gaiaReadShpEntity_ex()
1937 if (shp->EffectiveDims == GAIA_XY_Z) in gaiaReadShpEntity_ex()
1942 else if (shp->EffectiveDims == GAIA_XY_M) in gaiaReadShpEntity_ex()
1947 else if (shp->EffectiveDims == GAIA_XY_Z_M) in gaiaReadShpEntity_ex()
1963 if (shp->memShp != NULL) in gaiaReadShpEntity_ex()
1964 rd = gaiaMemRead (shp->BufShp, 24, shp->memShp); in gaiaReadShpEntity_ex()
1966 rd = fread (shp->BufShp, sizeof (unsigned char), 24, shp->flShp); in gaiaReadShpEntity_ex()
1969 x = gaiaImport64 (shp->BufShp, GAIA_LITTLE_ENDIAN, shp->endian_arch); in gaiaReadShpEntity_ex()
1970 y = gaiaImport64 (shp->BufShp + 8, GAIA_LITTLE_ENDIAN, in gaiaReadShpEntity_ex()
1971 shp->endian_arch); in gaiaReadShpEntity_ex()
1972 m = gaiaImport64 (shp->BufShp + 16, GAIA_LITTLE_ENDIAN, in gaiaReadShpEntity_ex()
1973 shp->endian_arch); in gaiaReadShpEntity_ex()
1974 if (shp->EffectiveDims == GAIA_XY_Z) in gaiaReadShpEntity_ex()
1979 else if (shp->EffectiveDims == GAIA_XY_M) in gaiaReadShpEntity_ex()
1984 else if (shp->EffectiveDims == GAIA_XY_Z_M) in gaiaReadShpEntity_ex()
2001 if (shp->memShp != NULL) in gaiaReadShpEntity_ex()
2002 rd = gaiaMemRead (shp->BufShp, 32, shp->memShp); in gaiaReadShpEntity_ex()
2004 rd = fread (shp->BufShp, sizeof (unsigned char), 32, shp->flShp); in gaiaReadShpEntity_ex()
2007 if (shp->memShp != NULL) in gaiaReadShpEntity_ex()
2008 rd = gaiaMemRead (shp->BufShp, (sz * 2) - 36, shp->memShp); in gaiaReadShpEntity_ex()
2010 rd = fread (shp->BufShp, sizeof (unsigned char), (sz * 2) - 36, in gaiaReadShpEntity_ex()
2011 shp->flShp); in gaiaReadShpEntity_ex()
2031 n = gaiaImport32 (shp->BufShp, GAIA_LITTLE_ENDIAN, shp->endian_arch); in gaiaReadShpEntity_ex()
2032 n1 = gaiaImport32 (shp->BufShp + 4, GAIA_LITTLE_ENDIAN, in gaiaReadShpEntity_ex()
2033 shp->endian_arch); in gaiaReadShpEntity_ex()
2047 gaiaImport32 (shp->BufShp + 8 + ((ind + 1) * 4), in gaiaReadShpEntity_ex()
2048 GAIA_LITTLE_ENDIAN, shp->endian_arch); in gaiaReadShpEntity_ex()
2052 if (shp->EffectiveDims == GAIA_XY_Z) in gaiaReadShpEntity_ex()
2054 else if (shp->EffectiveDims == GAIA_XY_M) in gaiaReadShpEntity_ex()
2056 else if (shp->EffectiveDims == GAIA_XY_Z_M) in gaiaReadShpEntity_ex()
2063 x = gaiaImport64 (shp->BufShp + base + (iv * 16), in gaiaReadShpEntity_ex()
2064 GAIA_LITTLE_ENDIAN, shp->endian_arch); in gaiaReadShpEntity_ex()
2065 y = gaiaImport64 (shp->BufShp + base + (iv * 16) + in gaiaReadShpEntity_ex()
2067 shp->endian_arch); in gaiaReadShpEntity_ex()
2068 if (shp->EffectiveDims == GAIA_XY_Z) in gaiaReadShpEntity_ex()
2072 else if (shp->EffectiveDims == GAIA_XY_M) in gaiaReadShpEntity_ex()
2076 else if (shp->EffectiveDims == GAIA_XY_Z_M) in gaiaReadShpEntity_ex()
2090 if (shp->EffectiveDims == GAIA_XY_Z) in gaiaReadShpEntity_ex()
2092 else if (shp->EffectiveDims == GAIA_XY_M) in gaiaReadShpEntity_ex()
2094 else if (shp->EffectiveDims == GAIA_XY_Z_M) in gaiaReadShpEntity_ex()
2098 if (shp->EffectiveType == GAIA_LINESTRING) in gaiaReadShpEntity_ex()
2110 if (shp->memShp != NULL) in gaiaReadShpEntity_ex()
2111 rd = gaiaMemRead (shp->BufShp, 32, shp->memShp); in gaiaReadShpEntity_ex()
2113 rd = fread (shp->BufShp, sizeof (unsigned char), 32, shp->flShp); in gaiaReadShpEntity_ex()
2116 if (shp->memShp != NULL) in gaiaReadShpEntity_ex()
2117 rd = gaiaMemRead (shp->BufShp, (sz * 2) - 36, shp->memShp); in gaiaReadShpEntity_ex()
2119 rd = fread (shp->BufShp, sizeof (unsigned char), (sz * 2) - 36, in gaiaReadShpEntity_ex()
2120 shp->flShp); in gaiaReadShpEntity_ex()
2123 n = gaiaImport32 (shp->BufShp, GAIA_LITTLE_ENDIAN, shp->endian_arch); in gaiaReadShpEntity_ex()
2124 n1 = gaiaImport32 (shp->BufShp + 4, GAIA_LITTLE_ENDIAN, in gaiaReadShpEntity_ex()
2125 shp->endian_arch); in gaiaReadShpEntity_ex()
2141 gaiaImport32 (shp->BufShp + 8 + ((ind + 1) * 4), in gaiaReadShpEntity_ex()
2142 GAIA_LITTLE_ENDIAN, shp->endian_arch); in gaiaReadShpEntity_ex()
2146 if (shp->EffectiveDims == GAIA_XY_Z) in gaiaReadShpEntity_ex()
2148 else if (shp->EffectiveDims == GAIA_XY_M) in gaiaReadShpEntity_ex()
2150 else if (shp->EffectiveDims == GAIA_XY_Z_M) in gaiaReadShpEntity_ex()
2157 x = gaiaImport64 (shp->BufShp + base + (iv * 16), in gaiaReadShpEntity_ex()
2158 GAIA_LITTLE_ENDIAN, shp->endian_arch); in gaiaReadShpEntity_ex()
2159 y = gaiaImport64 (shp->BufShp + base + (iv * 16) + in gaiaReadShpEntity_ex()
2161 shp->endian_arch); in gaiaReadShpEntity_ex()
2162 z = gaiaImport64 (shp->BufShp + baseZ + (iv * 8), in gaiaReadShpEntity_ex()
2163 GAIA_LITTLE_ENDIAN, shp->endian_arch); in gaiaReadShpEntity_ex()
2165 m = gaiaImport64 (shp->BufShp + baseM + in gaiaReadShpEntity_ex()
2167 shp->endian_arch); in gaiaReadShpEntity_ex()
2172 if (shp->EffectiveDims == GAIA_XY_Z) in gaiaReadShpEntity_ex()
2176 else if (shp->EffectiveDims == GAIA_XY_M) in gaiaReadShpEntity_ex()
2180 else if (shp->EffectiveDims == GAIA_XY_Z_M) in gaiaReadShpEntity_ex()
2193 if (shp->EffectiveDims == GAIA_XY_Z) in gaiaReadShpEntity_ex()
2195 else if (shp->EffectiveDims == GAIA_XY_M) in gaiaReadShpEntity_ex()
2197 else if (shp->EffectiveDims == GAIA_XY_Z_M) in gaiaReadShpEntity_ex()
2201 if (shp->EffectiveType == GAIA_LINESTRING) in gaiaReadShpEntity_ex()
2213 if (shp->memShp != NULL) in gaiaReadShpEntity_ex()
2214 rd = gaiaMemRead (shp->BufShp, 32, shp->memShp); in gaiaReadShpEntity_ex()
2216 rd = fread (shp->BufShp, sizeof (unsigned char), 32, shp->flShp); in gaiaReadShpEntity_ex()
2219 if (shp->memShp != NULL) in gaiaReadShpEntity_ex()
2220 rd = gaiaMemRead (shp->BufShp, (sz * 2) - 36, shp->memShp); in gaiaReadShpEntity_ex()
2222 rd = fread (shp->BufShp, sizeof (unsigned char), (sz * 2) - 36, in gaiaReadShpEntity_ex()
2223 shp->flShp); in gaiaReadShpEntity_ex()
2226 n = gaiaImport32 (shp->BufShp, GAIA_LITTLE_ENDIAN, shp->endian_arch); in gaiaReadShpEntity_ex()
2227 n1 = gaiaImport32 (shp->BufShp + 4, GAIA_LITTLE_ENDIAN, in gaiaReadShpEntity_ex()
2228 shp->endian_arch); in gaiaReadShpEntity_ex()
2243 gaiaImport32 (shp->BufShp + 8 + ((ind + 1) * 4), in gaiaReadShpEntity_ex()
2244 GAIA_LITTLE_ENDIAN, shp->endian_arch); in gaiaReadShpEntity_ex()
2248 if (shp->EffectiveDims == GAIA_XY_Z) in gaiaReadShpEntity_ex()
2250 else if (shp->EffectiveDims == GAIA_XY_M) in gaiaReadShpEntity_ex()
2252 else if (shp->EffectiveDims == GAIA_XY_Z_M) in gaiaReadShpEntity_ex()
2259 x = gaiaImport64 (shp->BufShp + base + (iv * 16), in gaiaReadShpEntity_ex()
2260 GAIA_LITTLE_ENDIAN, shp->endian_arch); in gaiaReadShpEntity_ex()
2261 y = gaiaImport64 (shp->BufShp + base + (iv * 16) + in gaiaReadShpEntity_ex()
2263 shp->endian_arch); in gaiaReadShpEntity_ex()
2265 m = gaiaImport64 (shp->BufShp + baseM + in gaiaReadShpEntity_ex()
2267 shp->endian_arch); in gaiaReadShpEntity_ex()
2272 if (shp->EffectiveDims == GAIA_XY_Z) in gaiaReadShpEntity_ex()
2276 else if (shp->EffectiveDims == GAIA_XY_M) in gaiaReadShpEntity_ex()
2280 else if (shp->EffectiveDims == GAIA_XY_Z_M) in gaiaReadShpEntity_ex()
2294 if (shp->EffectiveDims == GAIA_XY_Z) in gaiaReadShpEntity_ex()
2296 else if (shp->EffectiveDims == GAIA_XY_M) in gaiaReadShpEntity_ex()
2298 else if (shp->EffectiveDims == GAIA_XY_Z_M) in gaiaReadShpEntity_ex()
2302 if (shp->EffectiveType == GAIA_LINESTRING) in gaiaReadShpEntity_ex()
2314 if (shp->memShp != NULL) in gaiaReadShpEntity_ex()
2315 rd = gaiaMemRead (shp->BufShp, 32, shp->memShp); in gaiaReadShpEntity_ex()
2317 rd = fread (shp->BufShp, sizeof (unsigned char), 32, shp->flShp); in gaiaReadShpEntity_ex()
2320 if (shp->memShp != NULL) in gaiaReadShpEntity_ex()
2321 rd = gaiaMemRead (shp->BufShp, (sz * 2) - 36, shp->memShp); in gaiaReadShpEntity_ex()
2323 rd = fread (shp->BufShp, sizeof (unsigned char), (sz * 2) - 36, in gaiaReadShpEntity_ex()
2324 shp->flShp); in gaiaReadShpEntity_ex()
2327 n = gaiaImport32 (shp->BufShp, GAIA_LITTLE_ENDIAN, shp->endian_arch); in gaiaReadShpEntity_ex()
2328 n1 = gaiaImport32 (shp->BufShp + 4, GAIA_LITTLE_ENDIAN, in gaiaReadShpEntity_ex()
2329 shp->endian_arch); in gaiaReadShpEntity_ex()
2336 gaiaImport32 (shp->BufShp + 8 + ((ind + 1) * 4), in gaiaReadShpEntity_ex()
2337 GAIA_LITTLE_ENDIAN, shp->endian_arch); in gaiaReadShpEntity_ex()
2341 if (shp->EffectiveDims == GAIA_XY_Z) in gaiaReadShpEntity_ex()
2343 else if (shp->EffectiveDims == GAIA_XY_M) in gaiaReadShpEntity_ex()
2345 else if (shp->EffectiveDims == GAIA_XY_Z_M) in gaiaReadShpEntity_ex()
2352 x = gaiaImport64 (shp->BufShp + base + (iv * 16), in gaiaReadShpEntity_ex()
2353 GAIA_LITTLE_ENDIAN, shp->endian_arch); in gaiaReadShpEntity_ex()
2354 y = gaiaImport64 (shp->BufShp + base + (iv * 16) + in gaiaReadShpEntity_ex()
2356 shp->endian_arch); in gaiaReadShpEntity_ex()
2357 if (shp->EffectiveDims == GAIA_XY_Z) in gaiaReadShpEntity_ex()
2361 else if (shp->EffectiveDims == GAIA_XY_M) in gaiaReadShpEntity_ex()
2365 else if (shp->EffectiveDims == GAIA_XY_Z_M) in gaiaReadShpEntity_ex()
2381 if (shp->EffectiveDims == GAIA_XY_Z) in gaiaReadShpEntity_ex()
2383 else if (shp->EffectiveDims == GAIA_XY_M) in gaiaReadShpEntity_ex()
2385 else if (shp->EffectiveDims == GAIA_XY_Z_M) in gaiaReadShpEntity_ex()
2389 if (shp->EffectiveType == GAIA_POLYGON) in gaiaReadShpEntity_ex()
2399 if (shp->memShp != NULL) in gaiaReadShpEntity_ex()
2400 rd = gaiaMemRead (shp->BufShp, 32, shp->memShp); in gaiaReadShpEntity_ex()
2402 rd = fread (shp->BufShp, sizeof (unsigned char), 32, shp->flShp); in gaiaReadShpEntity_ex()
2405 if (shp->memShp != NULL) in gaiaReadShpEntity_ex()
2406 rd = gaiaMemRead (shp->BufShp, (sz * 2) - 36, shp->memShp); in gaiaReadShpEntity_ex()
2408 rd = fread (shp->BufShp, sizeof (unsigned char), (sz * 2) - 36, in gaiaReadShpEntity_ex()
2409 shp->flShp); in gaiaReadShpEntity_ex()
2412 n = gaiaImport32 (shp->BufShp, GAIA_LITTLE_ENDIAN, shp->endian_arch); in gaiaReadShpEntity_ex()
2413 n1 = gaiaImport32 (shp->BufShp + 4, GAIA_LITTLE_ENDIAN, in gaiaReadShpEntity_ex()
2414 shp->endian_arch); in gaiaReadShpEntity_ex()
2430 gaiaImport32 (shp->BufShp + 8 + ((ind + 1) * 4), in gaiaReadShpEntity_ex()
2431 GAIA_LITTLE_ENDIAN, shp->endian_arch); in gaiaReadShpEntity_ex()
2435 if (shp->EffectiveDims == GAIA_XY_Z) in gaiaReadShpEntity_ex()
2437 else if (shp->EffectiveDims == GAIA_XY_M) in gaiaReadShpEntity_ex()
2439 else if (shp->EffectiveDims == GAIA_XY_Z_M) in gaiaReadShpEntity_ex()
2446 x = gaiaImport64 (shp->BufShp + base + (iv * 16), in gaiaReadShpEntity_ex()
2447 GAIA_LITTLE_ENDIAN, shp->endian_arch); in gaiaReadShpEntity_ex()
2448 y = gaiaImport64 (shp->BufShp + base + (iv * 16) + in gaiaReadShpEntity_ex()
2450 shp->endian_arch); in gaiaReadShpEntity_ex()
2451 z = gaiaImport64 (shp->BufShp + baseZ + (iv * 8), in gaiaReadShpEntity_ex()
2452 GAIA_LITTLE_ENDIAN, shp->endian_arch); in gaiaReadShpEntity_ex()
2454 m = gaiaImport64 (shp->BufShp + baseM + in gaiaReadShpEntity_ex()
2456 shp->endian_arch); in gaiaReadShpEntity_ex()
2461 if (shp->EffectiveDims == GAIA_XY_Z) in gaiaReadShpEntity_ex()
2465 else if (shp->EffectiveDims == GAIA_XY_M) in gaiaReadShpEntity_ex()
2469 else if (shp->EffectiveDims == GAIA_XY_Z_M) in gaiaReadShpEntity_ex()
2484 if (shp->EffectiveDims == GAIA_XY_Z) in gaiaReadShpEntity_ex()
2486 else if (shp->EffectiveDims == GAIA_XY_M) in gaiaReadShpEntity_ex()
2488 else if (shp->EffectiveDims == GAIA_XY_Z_M) in gaiaReadShpEntity_ex()
2492 if (shp->EffectiveType == GAIA_POLYGON) in gaiaReadShpEntity_ex()
2502 if (shp->memShp != NULL) in gaiaReadShpEntity_ex()
2503 rd = gaiaMemRead (shp->BufShp, 32, shp->memShp); in gaiaReadShpEntity_ex()
2505 rd = fread (shp->BufShp, sizeof (unsigned char), 32, shp->flShp); in gaiaReadShpEntity_ex()
2508 if (shp->memShp != NULL) in gaiaReadShpEntity_ex()
2509 rd = gaiaMemRead (shp->BufShp, (sz * 2) - 36, shp->memShp); in gaiaReadShpEntity_ex()
2511 rd = fread (shp->BufShp, sizeof (unsigned char), (sz * 2) - 36, in gaiaReadShpEntity_ex()
2512 shp->flShp); in gaiaReadShpEntity_ex()
2515 n = gaiaImport32 (shp->BufShp, GAIA_LITTLE_ENDIAN, shp->endian_arch); in gaiaReadShpEntity_ex()
2516 n1 = gaiaImport32 (shp->BufShp + 4, GAIA_LITTLE_ENDIAN, in gaiaReadShpEntity_ex()
2517 shp->endian_arch); in gaiaReadShpEntity_ex()
2532 gaiaImport32 (shp->BufShp + 8 + ((ind + 1) * 4), in gaiaReadShpEntity_ex()
2533 GAIA_LITTLE_ENDIAN, shp->endian_arch); in gaiaReadShpEntity_ex()
2537 if (shp->EffectiveDims == GAIA_XY_Z) in gaiaReadShpEntity_ex()
2539 else if (shp->EffectiveDims == GAIA_XY_M) in gaiaReadShpEntity_ex()
2541 else if (shp->EffectiveDims == GAIA_XY_Z_M) in gaiaReadShpEntity_ex()
2548 x = gaiaImport64 (shp->BufShp + base + (iv * 16), in gaiaReadShpEntity_ex()
2549 GAIA_LITTLE_ENDIAN, shp->endian_arch); in gaiaReadShpEntity_ex()
2550 y = gaiaImport64 (shp->BufShp + base + (iv * 16) + in gaiaReadShpEntity_ex()
2552 shp->endian_arch); in gaiaReadShpEntity_ex()
2554 m = gaiaImport64 (shp->BufShp + baseM + in gaiaReadShpEntity_ex()
2556 shp->endian_arch); in gaiaReadShpEntity_ex()
2560 if (shp->EffectiveDims == GAIA_XY_Z) in gaiaReadShpEntity_ex()
2564 else if (shp->EffectiveDims == GAIA_XY_M) in gaiaReadShpEntity_ex()
2568 else if (shp->EffectiveDims == GAIA_XY_Z_M) in gaiaReadShpEntity_ex()
2584 if (shp->EffectiveDims == GAIA_XY_Z) in gaiaReadShpEntity_ex()
2586 else if (shp->EffectiveDims == GAIA_XY_M) in gaiaReadShpEntity_ex()
2588 else if (shp->EffectiveDims == GAIA_XY_Z_M) in gaiaReadShpEntity_ex()
2592 if (shp->EffectiveType == GAIA_POLYGON) in gaiaReadShpEntity_ex()
2602 if (shp->memShp != NULL) in gaiaReadShpEntity_ex()
2603 rd = gaiaMemRead (shp->BufShp, 32, shp->memShp); in gaiaReadShpEntity_ex()
2605 rd = fread (shp->BufShp, sizeof (unsigned char), 32, shp->flShp); in gaiaReadShpEntity_ex()
2608 if (shp->memShp != NULL) in gaiaReadShpEntity_ex()
2609 rd = gaiaMemRead (shp->BufShp, (sz * 2) - 36, shp->memShp); in gaiaReadShpEntity_ex()
2611 rd = fread (shp->BufShp, sizeof (unsigned char), (sz * 2) - 36, in gaiaReadShpEntity_ex()
2612 shp->flShp); in gaiaReadShpEntity_ex()
2615 n = gaiaImport32 (shp->BufShp, GAIA_LITTLE_ENDIAN, shp->endian_arch); in gaiaReadShpEntity_ex()
2616 if (shp->EffectiveDims == GAIA_XY_Z) in gaiaReadShpEntity_ex()
2618 else if (shp->EffectiveDims == GAIA_XY_M) in gaiaReadShpEntity_ex()
2620 else if (shp->EffectiveDims == GAIA_XY_Z_M) in gaiaReadShpEntity_ex()
2628 x = gaiaImport64 (shp->BufShp + 4 + (iv * 16), in gaiaReadShpEntity_ex()
2629 GAIA_LITTLE_ENDIAN, shp->endian_arch); in gaiaReadShpEntity_ex()
2630 y = gaiaImport64 (shp->BufShp + 4 + (iv * 16) + 8, in gaiaReadShpEntity_ex()
2631 GAIA_LITTLE_ENDIAN, shp->endian_arch); in gaiaReadShpEntity_ex()
2632 if (shp->EffectiveDims == GAIA_XY_Z) in gaiaReadShpEntity_ex()
2634 else if (shp->EffectiveDims == GAIA_XY_M) in gaiaReadShpEntity_ex()
2636 else if (shp->EffectiveDims == GAIA_XY_Z_M) in gaiaReadShpEntity_ex()
2645 if (shp->memShp != NULL) in gaiaReadShpEntity_ex()
2646 rd = gaiaMemRead (shp->BufShp, 32, shp->memShp); in gaiaReadShpEntity_ex()
2648 rd = fread (shp->BufShp, sizeof (unsigned char), 32, shp->flShp); in gaiaReadShpEntity_ex()
2651 if (shp->memShp != NULL) in gaiaReadShpEntity_ex()
2652 rd = gaiaMemRead (shp->BufShp, (sz * 2) - 36, shp->memShp); in gaiaReadShpEntity_ex()
2654 rd = fread (shp->BufShp, sizeof (unsigned char), (sz * 2) - 36, in gaiaReadShpEntity_ex()
2655 shp->flShp); in gaiaReadShpEntity_ex()
2658 n = gaiaImport32 (shp->BufShp, GAIA_LITTLE_ENDIAN, shp->endian_arch); in gaiaReadShpEntity_ex()
2668 if (shp->EffectiveDims == GAIA_XY_Z) in gaiaReadShpEntity_ex()
2670 else if (shp->EffectiveDims == GAIA_XY_M) in gaiaReadShpEntity_ex()
2672 else if (shp->EffectiveDims == GAIA_XY_Z_M) in gaiaReadShpEntity_ex()
2680 x = gaiaImport64 (shp->BufShp + 4 + (iv * 16), in gaiaReadShpEntity_ex()
2681 GAIA_LITTLE_ENDIAN, shp->endian_arch); in gaiaReadShpEntity_ex()
2682 y = gaiaImport64 (shp->BufShp + 4 + (iv * 16) + 8, in gaiaReadShpEntity_ex()
2683 GAIA_LITTLE_ENDIAN, shp->endian_arch); in gaiaReadShpEntity_ex()
2684 z = gaiaImport64 (shp->BufShp + baseZ + (iv * 8), in gaiaReadShpEntity_ex()
2685 GAIA_LITTLE_ENDIAN, shp->endian_arch); in gaiaReadShpEntity_ex()
2687 m = gaiaImport64 (shp->BufShp + baseM + (iv * 8), in gaiaReadShpEntity_ex()
2688 GAIA_LITTLE_ENDIAN, shp->endian_arch); in gaiaReadShpEntity_ex()
2693 if (shp->EffectiveDims == GAIA_XY_Z) in gaiaReadShpEntity_ex()
2695 else if (shp->EffectiveDims == GAIA_XY_M) in gaiaReadShpEntity_ex()
2697 else if (shp->EffectiveDims == GAIA_XY_Z_M) in gaiaReadShpEntity_ex()
2706 if (shp->memShp != NULL) in gaiaReadShpEntity_ex()
2707 rd = gaiaMemRead (shp->BufShp, 32, shp->memShp); in gaiaReadShpEntity_ex()
2709 rd = fread (shp->BufShp, sizeof (unsigned char), 32, shp->flShp); in gaiaReadShpEntity_ex()
2712 if (shp->memShp != NULL) in gaiaReadShpEntity_ex()
2713 rd = gaiaMemRead (shp->BufShp, (sz * 2) - 36, shp->memShp); in gaiaReadShpEntity_ex()
2715 rd = fread (shp->BufShp, sizeof (unsigned char), (sz * 2) - 36, in gaiaReadShpEntity_ex()
2716 shp->flShp); in gaiaReadShpEntity_ex()
2719 n = gaiaImport32 (shp->BufShp, GAIA_LITTLE_ENDIAN, shp->endian_arch); in gaiaReadShpEntity_ex()
2728 if (shp->EffectiveDims == GAIA_XY_Z) in gaiaReadShpEntity_ex()
2730 else if (shp->EffectiveDims == GAIA_XY_M) in gaiaReadShpEntity_ex()
2732 else if (shp->EffectiveDims == GAIA_XY_Z_M) in gaiaReadShpEntity_ex()
2740 x = gaiaImport64 (shp->BufShp + 4 + (iv * 16), in gaiaReadShpEntity_ex()
2741 GAIA_LITTLE_ENDIAN, shp->endian_arch); in gaiaReadShpEntity_ex()
2742 y = gaiaImport64 (shp->BufShp + 4 + (iv * 16) + 8, in gaiaReadShpEntity_ex()
2743 GAIA_LITTLE_ENDIAN, shp->endian_arch); in gaiaReadShpEntity_ex()
2745 m = gaiaImport64 (shp->BufShp + baseM + (iv * 8), in gaiaReadShpEntity_ex()
2746 GAIA_LITTLE_ENDIAN, shp->endian_arch); in gaiaReadShpEntity_ex()
2751 if (shp->EffectiveDims == GAIA_XY_Z) in gaiaReadShpEntity_ex()
2753 else if (shp->EffectiveDims == GAIA_XY_M) in gaiaReadShpEntity_ex()
2755 else if (shp->EffectiveDims == GAIA_XY_Z_M) in gaiaReadShpEntity_ex()
2763 gaiaResetDbfEntity (shp->Dbf); in gaiaReadShpEntity_ex()
2764 shp->Dbf->RowId = current_row; in gaiaReadShpEntity_ex()
2765 shp->Dbf->Geometry = geom; in gaiaReadShpEntity_ex()
2767 pFld = shp->Dbf->First; in gaiaReadShpEntity_ex()
2770 if (!parseDbfField (shp->BufDbf, shp->IconvObj, pFld, text_dates)) in gaiaReadShpEntity_ex()
2773 memcpy (text, shp->BufDbf + pFld->Offset + 1, pFld->Length); in gaiaReadShpEntity_ex()
2782 if (shp->LastError) in gaiaReadShpEntity_ex()
2783 free (shp->LastError); in gaiaReadShpEntity_ex()
2784 shp->LastError = NULL; in gaiaReadShpEntity_ex()
2788 if (shp->LastError) in gaiaReadShpEntity_ex()
2789 free (shp->LastError); in gaiaReadShpEntity_ex()
2790 shp->LastError = NULL; in gaiaReadShpEntity_ex()
2794 if (shp->LastError) in gaiaReadShpEntity_ex()
2795 free (shp->LastError); in gaiaReadShpEntity_ex()
2796 sprintf (errMsg, "'%s' is corrupted / has invalid format", shp->Path); in gaiaReadShpEntity_ex()
2798 shp->LastError = malloc (len + 1); in gaiaReadShpEntity_ex()
2799 strcpy (shp->LastError, errMsg); in gaiaReadShpEntity_ex()
2803 if (shp->LastError) in gaiaReadShpEntity_ex()
2804 free (shp->LastError); in gaiaReadShpEntity_ex()
2805 shp->LastError = NULL; in gaiaReadShpEntity_ex()
2808 if (shp->LastError) in gaiaReadShpEntity_ex()
2809 free (shp->LastError); in gaiaReadShpEntity_ex()
2812 shp->LastError = malloc (len + 1); in gaiaReadShpEntity_ex()
2813 strcpy (shp->LastError, errMsg); in gaiaReadShpEntity_ex()
2949 gaiaWriteShpEntity (gaiaShapefilePtr shp, gaiaDbfListPtr entity) in gaiaWriteShpEntity() argument
2954 int endian_arch = shp->endian_arch; in gaiaWriteShpEntity()
2982 memset (shp->BufDbf, '\0', shp->DbfReclen); in gaiaWriteShpEntity()
2983 *(shp->BufDbf) = ' '; /* in DBF first byte of each row marks for validity or deletion */ in gaiaWriteShpEntity()
2992 *(shp->BufDbf + fld->Offset) = '?'; in gaiaWriteShpEntity()
2994 *(shp->BufDbf + fld->Offset + 1) = '?'; in gaiaWriteShpEntity()
2998 *(shp->BufDbf + fld->Offset + 1) = 'N'; in gaiaWriteShpEntity()
3000 *(shp->BufDbf + fld->Offset + 1) = 'Y'; in gaiaWriteShpEntity()
3004 memset (shp->BufDbf + fld->Offset + 1, '0', 8); in gaiaWriteShpEntity()
3010 memcpy (shp->BufDbf + fld->Offset + 1, in gaiaWriteShpEntity()
3016 memset (shp->BufDbf + fld->Offset + 1, ' ', fld->Length); in gaiaWriteShpEntity()
3033 ((iconv_t) (shp->IconvObj), &pBuf, &len, in gaiaWriteShpEntity()
3045 memcpy (shp->BufDbf + fld->Offset + 1, dynbuf, in gaiaWriteShpEntity()
3048 memcpy (shp->BufDbf + fld->Offset + 1, dynbuf, in gaiaWriteShpEntity()
3055 memset (shp->BufDbf + fld->Offset + 1, '\0', fld->Length); in gaiaWriteShpEntity()
3062 memcpy (shp->BufDbf + fld->Offset + 1, in gaiaWriteShpEntity()
3070 memcpy (shp->BufDbf + fld->Offset + 1, in gaiaWriteShpEntity()
3081 …gaiaExport32 (shp->BufShp, shp->ShpSize, GAIA_BIG_ENDIAN, endian_arch); /* exports current SHP fil… in gaiaWriteShpEntity()
3082 …gaiaExport32 (shp->BufShp + 4, 2, GAIA_BIG_ENDIAN, endian_arch); /* exports entitiy size [in 16 bi… in gaiaWriteShpEntity()
3083 fwrite (shp->BufShp, 1, 8, shp->flShx); in gaiaWriteShpEntity()
3084 (shp->ShxSize) += 4; /* updating current SHX file position [in 16 bits words !!!] */ in gaiaWriteShpEntity()
3085 …gaiaExport32 (shp->BufShp, shp->DbfRecno + 1, GAIA_BIG_ENDIAN, endian_arch); /* exports entity ID … in gaiaWriteShpEntity()
3086 …gaiaExport32 (shp->BufShp + 4, 2, GAIA_BIG_ENDIAN, endian_arch); /* exports entity size [in 16 bit… in gaiaWriteShpEntity()
3087 …gaiaExport32 (shp->BufShp + 8, GAIA_SHP_NULL, GAIA_LITTLE_ENDIAN, endian_arch); /* exports geometr… in gaiaWriteShpEntity()
3088 fwrite (shp->BufShp, 1, 12, shp->flShp); in gaiaWriteShpEntity()
3089 (shp->ShpSize) += 6; /* updating current SHP file position [in 16 bits words !!!] */ in gaiaWriteShpEntity()
3095 if (entity->Geometry->MinX < shp->MinX) in gaiaWriteShpEntity()
3096 shp->MinX = entity->Geometry->MinX; in gaiaWriteShpEntity()
3097 if (entity->Geometry->MaxX > shp->MaxX) in gaiaWriteShpEntity()
3098 shp->MaxX = entity->Geometry->MaxX; in gaiaWriteShpEntity()
3099 if (entity->Geometry->MinY < shp->MinY) in gaiaWriteShpEntity()
3100 shp->MinY = entity->Geometry->MinY; in gaiaWriteShpEntity()
3101 if (entity->Geometry->MaxY > shp->MaxY) in gaiaWriteShpEntity()
3102 shp->MaxY = entity->Geometry->MaxY; in gaiaWriteShpEntity()
3103 if (shp->Shape == GAIA_SHP_POINT) in gaiaWriteShpEntity()
3111 if (shp->LastError) in gaiaWriteShpEntity()
3112 free (shp->LastError); in gaiaWriteShpEntity()
3114 shp->LastError = malloc (len + 1); in gaiaWriteShpEntity()
3115 strcpy (shp->LastError, dummy); in gaiaWriteShpEntity()
3119 …gaiaExport32 (shp->BufShp, shp->ShpSize, GAIA_BIG_ENDIAN, endian_arch); /* exports current SHP fil… in gaiaWriteShpEntity()
3120 …gaiaExport32 (shp->BufShp + 4, 10, GAIA_BIG_ENDIAN, endian_arch); /* exports entitiy size [in 16 b… in gaiaWriteShpEntity()
3121 fwrite (shp->BufShp, 1, 8, shp->flShx); in gaiaWriteShpEntity()
3122 (shp->ShxSize) += 4; /* updating current SHX file position [in 16 bits words !!!] */ in gaiaWriteShpEntity()
3124 …gaiaExport32 (shp->BufShp, shp->DbfRecno + 1, GAIA_BIG_ENDIAN, endian_arch); /* exports entity ID … in gaiaWriteShpEntity()
3125 …gaiaExport32 (shp->BufShp + 4, 10, GAIA_BIG_ENDIAN, endian_arch); /* exports entity size [in 16 bi… in gaiaWriteShpEntity()
3126 …gaiaExport32 (shp->BufShp + 8, GAIA_SHP_POINT, GAIA_LITTLE_ENDIAN, endian_arch); /* exports geomet… in gaiaWriteShpEntity()
3127 …gaiaExport64 (shp->BufShp + 12, pt->X, GAIA_LITTLE_ENDIAN, endian_arch); /* exports X coordinate */ in gaiaWriteShpEntity()
3128 …gaiaExport64 (shp->BufShp + 20, pt->Y, GAIA_LITTLE_ENDIAN, endian_arch); /* exports Y coordinate */ in gaiaWriteShpEntity()
3129 fwrite (shp->BufShp, 1, 28, shp->flShp); in gaiaWriteShpEntity()
3130 (shp->ShpSize) += 14; /* updating current SHP file position [in 16 bits words !!!] */ in gaiaWriteShpEntity()
3132 if (shp->Shape == GAIA_SHP_POINTZ) in gaiaWriteShpEntity()
3140 if (shp->LastError) in gaiaWriteShpEntity()
3141 free (shp->LastError); in gaiaWriteShpEntity()
3143 shp->LastError = malloc (len + 1); in gaiaWriteShpEntity()
3144 strcpy (shp->LastError, dummy); in gaiaWriteShpEntity()
3148 …gaiaExport32 (shp->BufShp, shp->ShpSize, GAIA_BIG_ENDIAN, endian_arch); /* exports current SHP fil… in gaiaWriteShpEntity()
3149 …gaiaExport32 (shp->BufShp + 4, 18, GAIA_BIG_ENDIAN, endian_arch); /* exports entitiy size [in 16 b… in gaiaWriteShpEntity()
3150 fwrite (shp->BufShp, 1, 8, shp->flShx); in gaiaWriteShpEntity()
3151 (shp->ShxSize) += 4; /* updating current SHX file position [in 16 bits words !!!] */ in gaiaWriteShpEntity()
3153 …gaiaExport32 (shp->BufShp, shp->DbfRecno + 1, GAIA_BIG_ENDIAN, endian_arch); /* exports entity ID … in gaiaWriteShpEntity()
3154 …gaiaExport32 (shp->BufShp + 4, 18, GAIA_BIG_ENDIAN, endian_arch); /* exports entity size [in 16 bi… in gaiaWriteShpEntity()
3155 …gaiaExport32 (shp->BufShp + 8, GAIA_SHP_POINTZ, GAIA_LITTLE_ENDIAN, endian_arch); /* exports geome… in gaiaWriteShpEntity()
3156 …gaiaExport64 (shp->BufShp + 12, pt->X, GAIA_LITTLE_ENDIAN, endian_arch); /* exports X coordinate */ in gaiaWriteShpEntity()
3157 …gaiaExport64 (shp->BufShp + 20, pt->Y, GAIA_LITTLE_ENDIAN, endian_arch); /* exports Y coordinate */ in gaiaWriteShpEntity()
3158 …gaiaExport64 (shp->BufShp + 28, pt->Z, GAIA_LITTLE_ENDIAN, endian_arch); /* exports Z coordinate */ in gaiaWriteShpEntity()
3159 …gaiaExport64 (shp->BufShp + 36, pt->M, GAIA_LITTLE_ENDIAN, endian_arch); /* exports M coordinate */ in gaiaWriteShpEntity()
3160 fwrite (shp->BufShp, 1, 44, shp->flShp); in gaiaWriteShpEntity()
3161 (shp->ShpSize) += 22; /* updating current SHP file position [in 16 bits words !!!] */ in gaiaWriteShpEntity()
3163 if (shp->Shape == GAIA_SHP_POINTM) in gaiaWriteShpEntity()
3171 if (shp->LastError) in gaiaWriteShpEntity()
3172 free (shp->LastError); in gaiaWriteShpEntity()
3174 shp->LastError = malloc (len + 1); in gaiaWriteShpEntity()
3175 strcpy (shp->LastError, dummy); in gaiaWriteShpEntity()
3179 …gaiaExport32 (shp->BufShp, shp->ShpSize, GAIA_BIG_ENDIAN, endian_arch); /* exports current SHP fil… in gaiaWriteShpEntity()
3180 …gaiaExport32 (shp->BufShp + 4, 14, GAIA_BIG_ENDIAN, endian_arch); /* exports entitiy size [in 16 b… in gaiaWriteShpEntity()
3181 fwrite (shp->BufShp, 1, 8, shp->flShx); in gaiaWriteShpEntity()
3182 (shp->ShxSize) += 4; /* updating current SHX file position [in 16 bits words !!!] */ in gaiaWriteShpEntity()
3184 …gaiaExport32 (shp->BufShp, shp->DbfRecno + 1, GAIA_BIG_ENDIAN, endian_arch); /* exports entity ID … in gaiaWriteShpEntity()
3185 …gaiaExport32 (shp->BufShp + 4, 14, GAIA_BIG_ENDIAN, endian_arch); /* exports entity size [in 16 bi… in gaiaWriteShpEntity()
3186 …gaiaExport32 (shp->BufShp + 8, GAIA_SHP_POINTM, GAIA_LITTLE_ENDIAN, endian_arch); /* exports geome… in gaiaWriteShpEntity()
3187 …gaiaExport64 (shp->BufShp + 12, pt->X, GAIA_LITTLE_ENDIAN, endian_arch); /* exports X coordinate */ in gaiaWriteShpEntity()
3188 …gaiaExport64 (shp->BufShp + 20, pt->Y, GAIA_LITTLE_ENDIAN, endian_arch); /* exports Y coordinate */ in gaiaWriteShpEntity()
3189 …gaiaExport64 (shp->BufShp + 28, pt->Y, GAIA_LITTLE_ENDIAN, endian_arch); /* exports M coordinate */ in gaiaWriteShpEntity()
3190 fwrite (shp->BufShp, 1, 36, shp->flShp); in gaiaWriteShpEntity()
3191 (shp->ShpSize) += 18; /* updating current SHP file position [in 16 bits words !!!] */ in gaiaWriteShpEntity()
3193 if (shp->Shape == GAIA_SHP_POLYLINE) in gaiaWriteShpEntity()
3211 if (shp->LastError) in gaiaWriteShpEntity()
3212 free (shp->LastError); in gaiaWriteShpEntity()
3214 shp->LastError = malloc (len + 1); in gaiaWriteShpEntity()
3215 strcpy (shp->LastError, dummy); in gaiaWriteShpEntity()
3219 if ((this_size * 2) + 1024 > shp->ShpBfsz) in gaiaWriteShpEntity()
3222 free (shp->BufShp); in gaiaWriteShpEntity()
3223 shp->ShpBfsz = (this_size * 2) + 1024; in gaiaWriteShpEntity()
3224 shp->BufShp = malloc (shp->ShpBfsz); in gaiaWriteShpEntity()
3227 …gaiaExport32 (shp->BufShp, shp->ShpSize, GAIA_BIG_ENDIAN, endian_arch); /* exports current SHP fil… in gaiaWriteShpEntity()
3228 …gaiaExport32 (shp->BufShp + 4, this_size, GAIA_BIG_ENDIAN, endian_arch); /* exports entitiy size [… in gaiaWriteShpEntity()
3229 fwrite (shp->BufShp, 1, 8, shp->flShx); in gaiaWriteShpEntity()
3230 (shp->ShxSize) += 4; in gaiaWriteShpEntity()
3232 …gaiaExport32 (shp->BufShp, shp->DbfRecno + 1, GAIA_BIG_ENDIAN, endian_arch); /* exports entity ID … in gaiaWriteShpEntity()
3233 …gaiaExport32 (shp->BufShp + 4, this_size, GAIA_BIG_ENDIAN, endian_arch); /* exports entity size [i… in gaiaWriteShpEntity()
3234 …gaiaExport32 (shp->BufShp + 8, GAIA_SHP_POLYLINE, GAIA_LITTLE_ENDIAN, endian_arch); /* exports geo… in gaiaWriteShpEntity()
3235 …gaiaExport64 (shp->BufShp + 12, entity->Geometry->MinX, GAIA_LITTLE_ENDIAN, endian_arch); /* expor… in gaiaWriteShpEntity()
3236 gaiaExport64 (shp->BufShp + 20, entity->Geometry->MinY, in gaiaWriteShpEntity()
3238 gaiaExport64 (shp->BufShp + 28, entity->Geometry->MaxX, in gaiaWriteShpEntity()
3240 gaiaExport64 (shp->BufShp + 36, entity->Geometry->MaxY, in gaiaWriteShpEntity()
3242 …gaiaExport32 (shp->BufShp + 44, tot_ln, GAIA_LITTLE_ENDIAN, endian_arch); /* exports # lines in th… in gaiaWriteShpEntity()
3243 …gaiaExport32 (shp->BufShp + 48, tot_v, GAIA_LITTLE_ENDIAN, endian_arch); /* exports total # points… in gaiaWriteShpEntity()
3250 gaiaExport32 (shp->BufShp + ix, tot_v, in gaiaWriteShpEntity()
3282 gaiaExport64 (shp->BufShp + ix, x, in gaiaWriteShpEntity()
3285 gaiaExport64 (shp->BufShp + ix, y, in gaiaWriteShpEntity()
3291 fwrite (shp->BufShp, 1, ix, shp->flShp); in gaiaWriteShpEntity()
3292 (shp->ShpSize) += (ix / 2); /* updating current SHP file position [in 16 bits words !!!] */ in gaiaWriteShpEntity()
3294 if (shp->Shape == GAIA_SHP_POLYLINEZ) in gaiaWriteShpEntity()
3314 if (shp->LastError) in gaiaWriteShpEntity()
3315 free (shp->LastError); in gaiaWriteShpEntity()
3317 shp->LastError = malloc (len + 1); in gaiaWriteShpEntity()
3318 strcpy (shp->LastError, dummy); in gaiaWriteShpEntity()
3322 if (shp->EffectiveDims == GAIA_XY_M in gaiaWriteShpEntity()
3323 || shp->EffectiveDims == GAIA_XY_Z_M) in gaiaWriteShpEntity()
3329 if ((this_size * 2) + 1024 > shp->ShpBfsz) in gaiaWriteShpEntity()
3332 free (shp->BufShp); in gaiaWriteShpEntity()
3333 shp->ShpBfsz = (this_size * 2) + 1024; in gaiaWriteShpEntity()
3334 shp->BufShp = malloc (shp->ShpBfsz); in gaiaWriteShpEntity()
3337 …gaiaExport32 (shp->BufShp, shp->ShpSize, GAIA_BIG_ENDIAN, endian_arch); /* exports current SHP fil… in gaiaWriteShpEntity()
3338 …gaiaExport32 (shp->BufShp + 4, this_size, GAIA_BIG_ENDIAN, endian_arch); /* exports entitiy size [… in gaiaWriteShpEntity()
3339 fwrite (shp->BufShp, 1, 8, shp->flShx); in gaiaWriteShpEntity()
3340 (shp->ShxSize) += 4; in gaiaWriteShpEntity()
3342 …gaiaExport32 (shp->BufShp, shp->DbfRecno + 1, GAIA_BIG_ENDIAN, endian_arch); /* exports entity ID … in gaiaWriteShpEntity()
3343 …gaiaExport32 (shp->BufShp + 4, this_size, GAIA_BIG_ENDIAN, endian_arch); /* exports entity size [i… in gaiaWriteShpEntity()
3344 …gaiaExport32 (shp->BufShp + 8, GAIA_SHP_POLYLINEZ, GAIA_LITTLE_ENDIAN, endian_arch); /* exports ge… in gaiaWriteShpEntity()
3345 …gaiaExport64 (shp->BufShp + 12, entity->Geometry->MinX, GAIA_LITTLE_ENDIAN, endian_arch); /* expor… in gaiaWriteShpEntity()
3346 gaiaExport64 (shp->BufShp + 20, entity->Geometry->MinY, in gaiaWriteShpEntity()
3348 gaiaExport64 (shp->BufShp + 28, entity->Geometry->MaxX, in gaiaWriteShpEntity()
3350 gaiaExport64 (shp->BufShp + 36, entity->Geometry->MaxY, in gaiaWriteShpEntity()
3352 …gaiaExport32 (shp->BufShp + 44, tot_ln, GAIA_LITTLE_ENDIAN, endian_arch); /* exports # lines in th… in gaiaWriteShpEntity()
3353 …gaiaExport32 (shp->BufShp + 48, tot_v, GAIA_LITTLE_ENDIAN, endian_arch); /* exports total # points… in gaiaWriteShpEntity()
3360 gaiaExport32 (shp->BufShp + ix, tot_v, in gaiaWriteShpEntity()
3392 gaiaExport64 (shp->BufShp + ix, x, in gaiaWriteShpEntity()
3395 gaiaExport64 (shp->BufShp + ix, y, in gaiaWriteShpEntity()
3402 gaiaExport64 (shp->BufShp + ix, minZ, GAIA_LITTLE_ENDIAN, in gaiaWriteShpEntity()
3405 gaiaExport64 (shp->BufShp + ix, maxZ, GAIA_LITTLE_ENDIAN, in gaiaWriteShpEntity()
3435 gaiaExport64 (shp->BufShp + ix, z, in gaiaWriteShpEntity()
3444 gaiaExport64 (shp->BufShp + ix, minM, in gaiaWriteShpEntity()
3447 gaiaExport64 (shp->BufShp + ix, maxM, in gaiaWriteShpEntity()
3477 gaiaExport64 (shp->BufShp + ix, m, in gaiaWriteShpEntity()
3485 fwrite (shp->BufShp, 1, ix, shp->flShp); in gaiaWriteShpEntity()
3486 (shp->ShpSize) += (ix / 2); /* updating current SHP file position [in 16 bits words !!!] */ in gaiaWriteShpEntity()
3488 if (shp->Shape == GAIA_SHP_POLYLINEM) in gaiaWriteShpEntity()
3507 if (shp->LastError) in gaiaWriteShpEntity()
3508 free (shp->LastError); in gaiaWriteShpEntity()
3510 shp->LastError = malloc (len + 1); in gaiaWriteShpEntity()
3511 strcpy (shp->LastError, dummy); in gaiaWriteShpEntity()
3515 if ((this_size * 2) + 1024 > shp->ShpBfsz) in gaiaWriteShpEntity()
3518 free (shp->BufShp); in gaiaWriteShpEntity()
3519 shp->ShpBfsz = (this_size * 2) + 1024; in gaiaWriteShpEntity()
3520 shp->BufShp = malloc (shp->ShpBfsz); in gaiaWriteShpEntity()
3523 …gaiaExport32 (shp->BufShp, shp->ShpSize, GAIA_BIG_ENDIAN, endian_arch); /* exports current SHP fil… in gaiaWriteShpEntity()
3524 …gaiaExport32 (shp->BufShp + 4, this_size, GAIA_BIG_ENDIAN, endian_arch); /* exports entitiy size [… in gaiaWriteShpEntity()
3525 fwrite (shp->BufShp, 1, 8, shp->flShx); in gaiaWriteShpEntity()
3526 (shp->ShxSize) += 4; in gaiaWriteShpEntity()
3528 …gaiaExport32 (shp->BufShp, shp->DbfRecno + 1, GAIA_BIG_ENDIAN, endian_arch); /* exports entity ID … in gaiaWriteShpEntity()
3529 …gaiaExport32 (shp->BufShp + 4, this_size, GAIA_BIG_ENDIAN, endian_arch); /* exports entity size [i… in gaiaWriteShpEntity()
3530 …gaiaExport32 (shp->BufShp + 8, GAIA_SHP_POLYLINEM, GAIA_LITTLE_ENDIAN, endian_arch); /* exports ge… in gaiaWriteShpEntity()
3531 …gaiaExport64 (shp->BufShp + 12, entity->Geometry->MinX, GAIA_LITTLE_ENDIAN, endian_arch); /* expor… in gaiaWriteShpEntity()
3532 gaiaExport64 (shp->BufShp + 20, entity->Geometry->MinY, in gaiaWriteShpEntity()
3534 gaiaExport64 (shp->BufShp + 28, entity->Geometry->MaxX, in gaiaWriteShpEntity()
3536 gaiaExport64 (shp->BufShp + 36, entity->Geometry->MaxY, in gaiaWriteShpEntity()
3538 …gaiaExport32 (shp->BufShp + 44, tot_ln, GAIA_LITTLE_ENDIAN, endian_arch); /* exports # lines in th… in gaiaWriteShpEntity()
3539 …gaiaExport32 (shp->BufShp + 48, tot_v, GAIA_LITTLE_ENDIAN, endian_arch); /* exports total # points… in gaiaWriteShpEntity()
3546 gaiaExport32 (shp->BufShp + ix, tot_v, in gaiaWriteShpEntity()
3578 gaiaExport64 (shp->BufShp + ix, x, in gaiaWriteShpEntity()
3581 gaiaExport64 (shp->BufShp + ix, y, in gaiaWriteShpEntity()
3588 gaiaExport64 (shp->BufShp + ix, minM, GAIA_LITTLE_ENDIAN, in gaiaWriteShpEntity()
3591 gaiaExport64 (shp->BufShp + ix, maxM, GAIA_LITTLE_ENDIAN, in gaiaWriteShpEntity()
3621 gaiaExport64 (shp->BufShp + ix, m, in gaiaWriteShpEntity()
3627 fwrite (shp->BufShp, 1, ix, shp->flShp); in gaiaWriteShpEntity()
3628 (shp->ShpSize) += (ix / 2); /* updating current SHP file position [in 16 bits words !!!] */ in gaiaWriteShpEntity()
3630 if (shp->Shape == GAIA_SHP_POLYGON) in gaiaWriteShpEntity()
3659 if (shp->LastError) in gaiaWriteShpEntity()
3660 free (shp->LastError); in gaiaWriteShpEntity()
3662 shp->LastError = malloc (len + 1); in gaiaWriteShpEntity()
3663 strcpy (shp->LastError, dummy); in gaiaWriteShpEntity()
3667 if ((this_size * 2) + 1024 > shp->ShpBfsz) in gaiaWriteShpEntity()
3670 free (shp->BufShp); in gaiaWriteShpEntity()
3671 shp->ShpBfsz = (this_size * 2) + 1024; in gaiaWriteShpEntity()
3672 shp->BufShp = malloc (shp->ShpBfsz); in gaiaWriteShpEntity()
3675 …gaiaExport32 (shp->BufShp, shp->ShpSize, GAIA_BIG_ENDIAN, endian_arch); /* exports current SHP fil… in gaiaWriteShpEntity()
3676 …gaiaExport32 (shp->BufShp + 4, this_size, GAIA_BIG_ENDIAN, endian_arch); /* exports entitiy size [… in gaiaWriteShpEntity()
3677 fwrite (shp->BufShp, 1, 8, shp->flShx); in gaiaWriteShpEntity()
3678 (shp->ShxSize) += 4; in gaiaWriteShpEntity()
3680 …gaiaExport32 (shp->BufShp, shp->DbfRecno + 1, GAIA_BIG_ENDIAN, endian_arch); /* exports entity ID … in gaiaWriteShpEntity()
3681 …gaiaExport32 (shp->BufShp + 4, this_size, GAIA_BIG_ENDIAN, endian_arch); /* exports entity size [i… in gaiaWriteShpEntity()
3682 …gaiaExport32 (shp->BufShp + 8, GAIA_SHP_POLYGON, GAIA_LITTLE_ENDIAN, endian_arch); /* exports geom… in gaiaWriteShpEntity()
3683 …gaiaExport64 (shp->BufShp + 12, entity->Geometry->MinX, GAIA_LITTLE_ENDIAN, endian_arch); /* expor… in gaiaWriteShpEntity()
3684 gaiaExport64 (shp->BufShp + 20, entity->Geometry->MinY, in gaiaWriteShpEntity()
3686 gaiaExport64 (shp->BufShp + 28, entity->Geometry->MaxX, in gaiaWriteShpEntity()
3688 gaiaExport64 (shp->BufShp + 36, entity->Geometry->MaxY, in gaiaWriteShpEntity()
3690 …gaiaExport32 (shp->BufShp + 44, tot_ln, GAIA_LITTLE_ENDIAN, endian_arch); /* exports # rings in th… in gaiaWriteShpEntity()
3691 …gaiaExport32 (shp->BufShp + 48, tot_v, GAIA_LITTLE_ENDIAN, endian_arch); /* exports total # points… in gaiaWriteShpEntity()
3699 gaiaExport32 (shp->BufShp + ix, tot_v, in gaiaWriteShpEntity()
3707 gaiaExport32 (shp->BufShp + ix, tot_v, in gaiaWriteShpEntity()
3741 gaiaExport64 (shp->BufShp + ix, x, in gaiaWriteShpEntity()
3744 gaiaExport64 (shp->BufShp + ix, y, in gaiaWriteShpEntity()
3774 gaiaExport64 (shp->BufShp + ix, x, in gaiaWriteShpEntity()
3778 gaiaExport64 (shp->BufShp + ix, y, in gaiaWriteShpEntity()
3786 fwrite (shp->BufShp, 1, ix, shp->flShp); in gaiaWriteShpEntity()
3787 (shp->ShpSize) += (ix / 2); in gaiaWriteShpEntity()
3789 if (shp->Shape == GAIA_SHP_POLYGONZ) in gaiaWriteShpEntity()
3820 if (shp->LastError) in gaiaWriteShpEntity()
3821 free (shp->LastError); in gaiaWriteShpEntity()
3823 shp->LastError = malloc (len + 1); in gaiaWriteShpEntity()
3824 strcpy (shp->LastError, dummy); in gaiaWriteShpEntity()
3828 if (shp->EffectiveDims == GAIA_XY_M in gaiaWriteShpEntity()
3829 || shp->EffectiveDims == GAIA_XY_Z_M) in gaiaWriteShpEntity()
3835 if ((this_size * 2) + 1024 > shp->ShpBfsz) in gaiaWriteShpEntity()
3838 free (shp->BufShp); in gaiaWriteShpEntity()
3839 shp->ShpBfsz = (this_size * 2) + 1024; in gaiaWriteShpEntity()
3840 shp->BufShp = malloc (shp->ShpBfsz); in gaiaWriteShpEntity()
3843 …gaiaExport32 (shp->BufShp, shp->ShpSize, GAIA_BIG_ENDIAN, endian_arch); /* exports current SHP fil… in gaiaWriteShpEntity()
3844 …gaiaExport32 (shp->BufShp + 4, this_size, GAIA_BIG_ENDIAN, endian_arch); /* exports entitiy size [… in gaiaWriteShpEntity()
3845 fwrite (shp->BufShp, 1, 8, shp->flShx); in gaiaWriteShpEntity()
3846 (shp->ShxSize) += 4; in gaiaWriteShpEntity()
3848 …gaiaExport32 (shp->BufShp, shp->DbfRecno + 1, GAIA_BIG_ENDIAN, endian_arch); /* exports entity ID … in gaiaWriteShpEntity()
3849 …gaiaExport32 (shp->BufShp + 4, this_size, GAIA_BIG_ENDIAN, endian_arch); /* exports entity size [i… in gaiaWriteShpEntity()
3850 …gaiaExport32 (shp->BufShp + 8, GAIA_SHP_POLYGONZ, GAIA_LITTLE_ENDIAN, endian_arch); /* exports geo… in gaiaWriteShpEntity()
3851 …gaiaExport64 (shp->BufShp + 12, entity->Geometry->MinX, GAIA_LITTLE_ENDIAN, endian_arch); /* expor… in gaiaWriteShpEntity()
3852 gaiaExport64 (shp->BufShp + 20, entity->Geometry->MinY, in gaiaWriteShpEntity()
3854 gaiaExport64 (shp->BufShp + 28, entity->Geometry->MaxX, in gaiaWriteShpEntity()
3856 gaiaExport64 (shp->BufShp + 36, entity->Geometry->MaxY, in gaiaWriteShpEntity()
3858 …gaiaExport32 (shp->BufShp + 44, tot_ln, GAIA_LITTLE_ENDIAN, endian_arch); /* exports # rings in th… in gaiaWriteShpEntity()
3859 …gaiaExport32 (shp->BufShp + 48, tot_v, GAIA_LITTLE_ENDIAN, endian_arch); /* exports total # points… in gaiaWriteShpEntity()
3867 gaiaExport32 (shp->BufShp + ix, tot_v, in gaiaWriteShpEntity()
3875 gaiaExport32 (shp->BufShp + ix, tot_v, in gaiaWriteShpEntity()
3909 gaiaExport64 (shp->BufShp + ix, x, in gaiaWriteShpEntity()
3912 gaiaExport64 (shp->BufShp + ix, y, in gaiaWriteShpEntity()
3942 gaiaExport64 (shp->BufShp + ix, x, in gaiaWriteShpEntity()
3946 gaiaExport64 (shp->BufShp + ix, y, in gaiaWriteShpEntity()
3955 gaiaExport64 (shp->BufShp + ix, minZ, GAIA_LITTLE_ENDIAN, in gaiaWriteShpEntity()
3958 gaiaExport64 (shp->BufShp + ix, maxZ, GAIA_LITTLE_ENDIAN, in gaiaWriteShpEntity()
3989 gaiaExport64 (shp->BufShp + ix, z, in gaiaWriteShpEntity()
4020 gaiaExport64 (shp->BufShp + ix, z, in gaiaWriteShpEntity()
4031 gaiaExport64 (shp->BufShp + ix, minM, in gaiaWriteShpEntity()
4034 gaiaExport64 (shp->BufShp + ix, maxM, in gaiaWriteShpEntity()
4065 gaiaExport64 (shp->BufShp + ix, m, in gaiaWriteShpEntity()
4101 gaiaExport64 (shp->BufShp + ix, m, in gaiaWriteShpEntity()
4110 fwrite (shp->BufShp, 1, ix, shp->flShp); in gaiaWriteShpEntity()
4111 (shp->ShpSize) += (ix / 2); in gaiaWriteShpEntity()
4113 if (shp->Shape == GAIA_SHP_POLYGONM) in gaiaWriteShpEntity()
4143 if (shp->LastError) in gaiaWriteShpEntity()
4144 free (shp->LastError); in gaiaWriteShpEntity()
4146 shp->LastError = malloc (len + 1); in gaiaWriteShpEntity()
4147 strcpy (shp->LastError, dummy); in gaiaWriteShpEntity()
4151 if ((this_size * 2) + 1024 > shp->ShpBfsz) in gaiaWriteShpEntity()
4154 free (shp->BufShp); in gaiaWriteShpEntity()
4155 shp->ShpBfsz = (this_size * 2) + 1024; in gaiaWriteShpEntity()
4156 shp->BufShp = malloc (shp->ShpBfsz); in gaiaWriteShpEntity()
4159 …gaiaExport32 (shp->BufShp, shp->ShpSize, GAIA_BIG_ENDIAN, endian_arch); /* exports current SHP fil… in gaiaWriteShpEntity()
4160 …gaiaExport32 (shp->BufShp + 4, this_size, GAIA_BIG_ENDIAN, endian_arch); /* exports entitiy size [… in gaiaWriteShpEntity()
4161 fwrite (shp->BufShp, 1, 8, shp->flShx); in gaiaWriteShpEntity()
4162 (shp->ShxSize) += 4; in gaiaWriteShpEntity()
4164 …gaiaExport32 (shp->BufShp, shp->DbfRecno + 1, GAIA_BIG_ENDIAN, endian_arch); /* exports entity ID … in gaiaWriteShpEntity()
4165 …gaiaExport32 (shp->BufShp + 4, this_size, GAIA_BIG_ENDIAN, endian_arch); /* exports entity size [i… in gaiaWriteShpEntity()
4166 …gaiaExport32 (shp->BufShp + 8, GAIA_SHP_POLYGONM, GAIA_LITTLE_ENDIAN, endian_arch); /* exports geo… in gaiaWriteShpEntity()
4167 …gaiaExport64 (shp->BufShp + 12, entity->Geometry->MinX, GAIA_LITTLE_ENDIAN, endian_arch); /* expor… in gaiaWriteShpEntity()
4168 gaiaExport64 (shp->BufShp + 20, entity->Geometry->MinY, in gaiaWriteShpEntity()
4170 gaiaExport64 (shp->BufShp + 28, entity->Geometry->MaxX, in gaiaWriteShpEntity()
4172 gaiaExport64 (shp->BufShp + 36, entity->Geometry->MaxY, in gaiaWriteShpEntity()
4174 …gaiaExport32 (shp->BufShp + 44, tot_ln, GAIA_LITTLE_ENDIAN, endian_arch); /* exports # rings in th… in gaiaWriteShpEntity()
4175 …gaiaExport32 (shp->BufShp + 48, tot_v, GAIA_LITTLE_ENDIAN, endian_arch); /* exports total # points… in gaiaWriteShpEntity()
4183 gaiaExport32 (shp->BufShp + ix, tot_v, in gaiaWriteShpEntity()
4191 gaiaExport32 (shp->BufShp + ix, tot_v, in gaiaWriteShpEntity()
4225 gaiaExport64 (shp->BufShp + ix, x, in gaiaWriteShpEntity()
4228 gaiaExport64 (shp->BufShp + ix, y, in gaiaWriteShpEntity()
4258 gaiaExport64 (shp->BufShp + ix, x, in gaiaWriteShpEntity()
4262 gaiaExport64 (shp->BufShp + ix, y, in gaiaWriteShpEntity()
4271 gaiaExport64 (shp->BufShp + ix, minM, GAIA_LITTLE_ENDIAN, in gaiaWriteShpEntity()
4274 gaiaExport64 (shp->BufShp + ix, maxM, GAIA_LITTLE_ENDIAN, in gaiaWriteShpEntity()
4305 gaiaExport64 (shp->BufShp + ix, m, in gaiaWriteShpEntity()
4336 gaiaExport64 (shp->BufShp + ix, m, in gaiaWriteShpEntity()
4344 fwrite (shp->BufShp, 1, ix, shp->flShp); in gaiaWriteShpEntity()
4345 (shp->ShpSize) += (ix / 2); in gaiaWriteShpEntity()
4347 if (shp->Shape == GAIA_SHP_MULTIPOINT) in gaiaWriteShpEntity()
4363 if (shp->LastError) in gaiaWriteShpEntity()
4364 free (shp->LastError); in gaiaWriteShpEntity()
4366 shp->LastError = malloc (len + 1); in gaiaWriteShpEntity()
4367 strcpy (shp->LastError, dummy); in gaiaWriteShpEntity()
4371 if ((this_size * 2) + 1024 > shp->ShpBfsz) in gaiaWriteShpEntity()
4374 free (shp->BufShp); in gaiaWriteShpEntity()
4375 shp->ShpBfsz = (this_size * 2) + 1024; in gaiaWriteShpEntity()
4376 shp->BufShp = malloc (shp->ShpBfsz); in gaiaWriteShpEntity()
4379 …gaiaExport32 (shp->BufShp, shp->ShpSize, GAIA_BIG_ENDIAN, endian_arch); /* exports current SHP fil… in gaiaWriteShpEntity()
4380 …gaiaExport32 (shp->BufShp + 4, this_size, GAIA_BIG_ENDIAN, endian_arch); /* exports entitiy size [… in gaiaWriteShpEntity()
4381 fwrite (shp->BufShp, 1, 8, shp->flShx); in gaiaWriteShpEntity()
4382 (shp->ShxSize) += 4; in gaiaWriteShpEntity()
4384 …gaiaExport32 (shp->BufShp, shp->DbfRecno + 1, GAIA_BIG_ENDIAN, endian_arch); /* exports entity ID … in gaiaWriteShpEntity()
4385 …gaiaExport32 (shp->BufShp + 4, this_size, GAIA_BIG_ENDIAN, endian_arch); /* exports entity size [i… in gaiaWriteShpEntity()
4386 …gaiaExport32 (shp->BufShp + 8, GAIA_SHP_MULTIPOINT, GAIA_LITTLE_ENDIAN, endian_arch); /* exports g… in gaiaWriteShpEntity()
4387 …gaiaExport64 (shp->BufShp + 12, entity->Geometry->MinX, GAIA_LITTLE_ENDIAN, endian_arch); /* expor… in gaiaWriteShpEntity()
4388 gaiaExport64 (shp->BufShp + 20, entity->Geometry->MinY, in gaiaWriteShpEntity()
4390 gaiaExport64 (shp->BufShp + 28, entity->Geometry->MaxX, in gaiaWriteShpEntity()
4392 gaiaExport64 (shp->BufShp + 36, entity->Geometry->MaxY, in gaiaWriteShpEntity()
4394 …gaiaExport32 (shp->BufShp + 44, tot_pts, GAIA_LITTLE_ENDIAN, endian_arch); /* exports total # poin… in gaiaWriteShpEntity()
4400 gaiaExport64 (shp->BufShp + ix, pt->X, in gaiaWriteShpEntity()
4403 gaiaExport64 (shp->BufShp + ix, pt->Y, in gaiaWriteShpEntity()
4408 fwrite (shp->BufShp, 1, ix, shp->flShp); in gaiaWriteShpEntity()
4409 (shp->ShpSize) += (ix / 2); /* updating current SHP file position [in 16 bits words !!!] */ in gaiaWriteShpEntity()
4411 if (shp->Shape == GAIA_SHP_MULTIPOINTZ) in gaiaWriteShpEntity()
4429 if (shp->LastError) in gaiaWriteShpEntity()
4430 free (shp->LastError); in gaiaWriteShpEntity()
4432 shp->LastError = malloc (len + 1); in gaiaWriteShpEntity()
4433 strcpy (shp->LastError, dummy); in gaiaWriteShpEntity()
4437 if (shp->EffectiveDims == GAIA_XY_M in gaiaWriteShpEntity()
4438 || shp->EffectiveDims == GAIA_XY_Z_M) in gaiaWriteShpEntity()
4444 if ((this_size * 2) + 1024 > shp->ShpBfsz) in gaiaWriteShpEntity()
4447 free (shp->BufShp); in gaiaWriteShpEntity()
4448 shp->ShpBfsz = (this_size * 2) + 1024; in gaiaWriteShpEntity()
4449 shp->BufShp = malloc (shp->ShpBfsz); in gaiaWriteShpEntity()
4452 …gaiaExport32 (shp->BufShp, shp->ShpSize, GAIA_BIG_ENDIAN, endian_arch); /* exports current SHP fil… in gaiaWriteShpEntity()
4453 …gaiaExport32 (shp->BufShp + 4, this_size, GAIA_BIG_ENDIAN, endian_arch); /* exports entitiy size [… in gaiaWriteShpEntity()
4454 fwrite (shp->BufShp, 1, 8, shp->flShx); in gaiaWriteShpEntity()
4455 (shp->ShxSize) += 4; in gaiaWriteShpEntity()
4457 …gaiaExport32 (shp->BufShp, shp->DbfRecno + 1, GAIA_BIG_ENDIAN, endian_arch); /* exports entity ID … in gaiaWriteShpEntity()
4458 …gaiaExport32 (shp->BufShp + 4, this_size, GAIA_BIG_ENDIAN, endian_arch); /* exports entity size [i… in gaiaWriteShpEntity()
4459 …gaiaExport32 (shp->BufShp + 8, GAIA_SHP_MULTIPOINTZ, GAIA_LITTLE_ENDIAN, endian_arch); /* exports … in gaiaWriteShpEntity()
4460 …gaiaExport64 (shp->BufShp + 12, entity->Geometry->MinX, GAIA_LITTLE_ENDIAN, endian_arch); /* expor… in gaiaWriteShpEntity()
4461 gaiaExport64 (shp->BufShp + 20, entity->Geometry->MinY, in gaiaWriteShpEntity()
4463 gaiaExport64 (shp->BufShp + 28, entity->Geometry->MaxX, in gaiaWriteShpEntity()
4465 gaiaExport64 (shp->BufShp + 36, entity->Geometry->MaxY, in gaiaWriteShpEntity()
4467 …gaiaExport32 (shp->BufShp + 44, tot_pts, GAIA_LITTLE_ENDIAN, endian_arch); /* exports total # poin… in gaiaWriteShpEntity()
4473 gaiaExport64 (shp->BufShp + ix, pt->X, in gaiaWriteShpEntity()
4476 gaiaExport64 (shp->BufShp + ix, pt->Y, in gaiaWriteShpEntity()
4482 gaiaExport64 (shp->BufShp + ix, minZ, GAIA_LITTLE_ENDIAN, in gaiaWriteShpEntity()
4485 gaiaExport64 (shp->BufShp + ix, maxZ, GAIA_LITTLE_ENDIAN, in gaiaWriteShpEntity()
4492 gaiaExport64 (shp->BufShp + ix, pt->Z, in gaiaWriteShpEntity()
4500 gaiaExport64 (shp->BufShp + ix, minM, in gaiaWriteShpEntity()
4503 gaiaExport64 (shp->BufShp + ix, maxM, in gaiaWriteShpEntity()
4510 gaiaExport64 (shp->BufShp + ix, pt->M, in gaiaWriteShpEntity()
4516 fwrite (shp->BufShp, 1, ix, shp->flShp); in gaiaWriteShpEntity()
4517 (shp->ShpSize) += (ix / 2); /* updating current SHP file position [in 16 bits words !!!] */ in gaiaWriteShpEntity()
4519 if (shp->Shape == GAIA_SHP_MULTIPOINTM) in gaiaWriteShpEntity()
4536 if (shp->LastError) in gaiaWriteShpEntity()
4537 free (shp->LastError); in gaiaWriteShpEntity()
4539 shp->LastError = malloc (len + 1); in gaiaWriteShpEntity()
4540 strcpy (shp->LastError, dummy); in gaiaWriteShpEntity()
4544 if ((this_size * 2) + 1024 > shp->ShpBfsz) in gaiaWriteShpEntity()
4547 free (shp->BufShp); in gaiaWriteShpEntity()
4548 shp->ShpBfsz = (this_size * 2) + 1024; in gaiaWriteShpEntity()
4549 shp->BufShp = malloc (shp->ShpBfsz); in gaiaWriteShpEntity()
4552 …gaiaExport32 (shp->BufShp, shp->ShpSize, GAIA_BIG_ENDIAN, endian_arch); /* exports current SHP fil… in gaiaWriteShpEntity()
4553 …gaiaExport32 (shp->BufShp + 4, this_size, GAIA_BIG_ENDIAN, endian_arch); /* exports entitiy size [… in gaiaWriteShpEntity()
4554 fwrite (shp->BufShp, 1, 8, shp->flShx); in gaiaWriteShpEntity()
4555 (shp->ShxSize) += 4; in gaiaWriteShpEntity()
4557 …gaiaExport32 (shp->BufShp, shp->DbfRecno + 1, GAIA_BIG_ENDIAN, endian_arch); /* exports entity ID … in gaiaWriteShpEntity()
4558 …gaiaExport32 (shp->BufShp + 4, this_size, GAIA_BIG_ENDIAN, endian_arch); /* exports entity size [i… in gaiaWriteShpEntity()
4559 …gaiaExport32 (shp->BufShp + 8, GAIA_SHP_MULTIPOINTM, GAIA_LITTLE_ENDIAN, endian_arch); /* exports … in gaiaWriteShpEntity()
4560 …gaiaExport64 (shp->BufShp + 12, entity->Geometry->MinX, GAIA_LITTLE_ENDIAN, endian_arch); /* expor… in gaiaWriteShpEntity()
4561 gaiaExport64 (shp->BufShp + 20, entity->Geometry->MinY, in gaiaWriteShpEntity()
4563 gaiaExport64 (shp->BufShp + 28, entity->Geometry->MaxX, in gaiaWriteShpEntity()
4565 gaiaExport64 (shp->BufShp + 36, entity->Geometry->MaxY, in gaiaWriteShpEntity()
4567 …gaiaExport32 (shp->BufShp + 44, tot_pts, GAIA_LITTLE_ENDIAN, endian_arch); /* exports total # poin… in gaiaWriteShpEntity()
4573 gaiaExport64 (shp->BufShp + ix, pt->X, in gaiaWriteShpEntity()
4576 gaiaExport64 (shp->BufShp + ix, pt->Y, in gaiaWriteShpEntity()
4582 gaiaExport64 (shp->BufShp + ix, minM, GAIA_LITTLE_ENDIAN, in gaiaWriteShpEntity()
4585 gaiaExport64 (shp->BufShp + ix, maxM, GAIA_LITTLE_ENDIAN, in gaiaWriteShpEntity()
4592 gaiaExport64 (shp->BufShp + ix, pt->M, in gaiaWriteShpEntity()
4597 fwrite (shp->BufShp, 1, ix, shp->flShp); in gaiaWriteShpEntity()
4598 (shp->ShpSize) += (ix / 2); /* updating current SHP file position [in 16 bits words !!!] */ in gaiaWriteShpEntity()
4602 fwrite (shp->BufDbf, 1, shp->DbfReclen, shp->flDbf); in gaiaWriteShpEntity()
4603 (shp->DbfRecno)++; in gaiaWriteShpEntity()
4606 if (shp->LastError) in gaiaWriteShpEntity()
4607 free (shp->LastError); in gaiaWriteShpEntity()
4610 shp->LastError = malloc (len + 1); in gaiaWriteShpEntity()
4611 strcpy (shp->LastError, dummy); in gaiaWriteShpEntity()
4616 gaiaFlushShpHeaders (gaiaShapefilePtr shp) in gaiaFlushShpHeaders() argument
4619 FILE *fl_shp = shp->flShp; in gaiaFlushShpHeaders()
4620 FILE *fl_shx = shp->flShx; in gaiaFlushShpHeaders()
4621 FILE *fl_dbf = shp->flDbf; in gaiaFlushShpHeaders()
4622 int shp_size = shp->ShpSize; in gaiaFlushShpHeaders()
4623 int shx_size = shp->ShxSize; in gaiaFlushShpHeaders()
4624 int dbf_size = shp->DbfSize; in gaiaFlushShpHeaders()
4625 int dbf_reclen = shp->DbfReclen; in gaiaFlushShpHeaders()
4626 int dbf_recno = shp->DbfRecno; in gaiaFlushShpHeaders()
4627 int endian_arch = shp->endian_arch; in gaiaFlushShpHeaders()
4628 double minx = shp->MinX; in gaiaFlushShpHeaders()
4629 double miny = shp->MinY; in gaiaFlushShpHeaders()
4630 double maxx = shp->MaxX; in gaiaFlushShpHeaders()
4631 double maxy = shp->MaxY; in gaiaFlushShpHeaders()
4632 unsigned char *buf_shp = shp->BufShp; in gaiaFlushShpHeaders()
4643 gaiaExport32 (buf_shp + 32, shp->Shape, GAIA_LITTLE_ENDIAN, endian_arch); /* ESRI shape */ in gaiaFlushShpHeaders()
4663 gaiaExport32 (buf_shp + 32, shp->Shape, GAIA_LITTLE_ENDIAN, endian_arch); /* ESRI shape */ in gaiaFlushShpHeaders()
4689 gaiaShpAnalyze (gaiaShapefilePtr shp) in gaiaShpAnalyze() argument
4722 if (shp->memShx != NULL) in gaiaShpAnalyze()
4723 skpos = gaiaMemFseek (shp->memShx, offset); in gaiaShpAnalyze()
4725 skpos = gaia_fseek (shp->flShx, offset, SEEK_SET); in gaiaShpAnalyze()
4728 if (shp->memShx != NULL) in gaiaShpAnalyze()
4729 rd = gaiaMemRead (buf, 8, shp->memShx); in gaiaShpAnalyze()
4731 rd = fread (buf, sizeof (unsigned char), 8, shp->flShx); in gaiaShpAnalyze()
4734 off_shp = gaiaImport32 (buf, GAIA_BIG_ENDIAN, shp->endian_arch); in gaiaShpAnalyze()
4737 if (shp->memShp != NULL) in gaiaShpAnalyze()
4738 skpos = gaiaMemFseek (shp->memShp, offset); in gaiaShpAnalyze()
4740 skpos = gaia_fseek (shp->flShp, offset, SEEK_SET); in gaiaShpAnalyze()
4743 if (shp->memShp != NULL) in gaiaShpAnalyze()
4744 rd = gaiaMemRead (buf, 12, shp->memShp); in gaiaShpAnalyze()
4746 rd = fread (buf, sizeof (unsigned char), 12, shp->flShp); in gaiaShpAnalyze()
4749 sz = gaiaImport32 (buf + 4, GAIA_BIG_ENDIAN, shp->endian_arch); in gaiaShpAnalyze()
4750 shape = gaiaImport32 (buf + 8, GAIA_LITTLE_ENDIAN, shp->endian_arch); in gaiaShpAnalyze()
4751 if ((sz * 2) > shp->ShpBfsz) in gaiaShpAnalyze()
4754 free (shp->BufShp); in gaiaShpAnalyze()
4755 shp->ShpBfsz = sz * 2; in gaiaShpAnalyze()
4756 shp->BufShp = malloc (sizeof (unsigned char) * shp->ShpBfsz); in gaiaShpAnalyze()
4762 if (shp->memShp != NULL) in gaiaShpAnalyze()
4763 rd = gaiaMemRead (shp->BufShp, 32, shp->memShp); in gaiaShpAnalyze()
4765 rd = fread (shp->BufShp, sizeof (unsigned char), 32, in gaiaShpAnalyze()
4766 shp->flShp); in gaiaShpAnalyze()
4769 if (shp->memShp != NULL) in gaiaShpAnalyze()
4770 rd = gaiaMemRead (shp->BufShp, (sz * 2) - 36, shp->memShp); in gaiaShpAnalyze()
4772 rd = fread (shp->BufShp, sizeof (unsigned char), in gaiaShpAnalyze()
4773 (sz * 2) - 36, shp->flShp); in gaiaShpAnalyze()
4776 n = gaiaImport32 (shp->BufShp, GAIA_LITTLE_ENDIAN, in gaiaShpAnalyze()
4777 shp->endian_arch); in gaiaShpAnalyze()
4778 n1 = gaiaImport32 (shp->BufShp + 4, GAIA_LITTLE_ENDIAN, in gaiaShpAnalyze()
4779 shp->endian_arch); in gaiaShpAnalyze()
4799 if (shp->memShp != NULL) in gaiaShpAnalyze()
4800 rd = gaiaMemRead (shp->BufShp, 32, shp->memShp); in gaiaShpAnalyze()
4802 rd = fread (shp->BufShp, sizeof (unsigned char), 32, in gaiaShpAnalyze()
4803 shp->flShp); in gaiaShpAnalyze()
4806 if (shp->memShp != NULL) in gaiaShpAnalyze()
4807 rd = gaiaMemRead (shp->BufShp, (sz * 2) - 36, shp->memShp); in gaiaShpAnalyze()
4809 rd = fread (shp->BufShp, sizeof (unsigned char), in gaiaShpAnalyze()
4810 (sz * 2) - 36, shp->flShp); in gaiaShpAnalyze()
4813 n = gaiaImport32 (shp->BufShp, GAIA_LITTLE_ENDIAN, in gaiaShpAnalyze()
4814 shp->endian_arch); in gaiaShpAnalyze()
4815 n1 = gaiaImport32 (shp->BufShp + 4, GAIA_LITTLE_ENDIAN, in gaiaShpAnalyze()
4816 shp->endian_arch); in gaiaShpAnalyze()
4823 gaiaImport32 (shp->BufShp + 8 + in gaiaShpAnalyze()
4826 shp->endian_arch); in gaiaShpAnalyze()
4834 x = gaiaImport64 (shp->BufShp + base + in gaiaShpAnalyze()
4836 shp->endian_arch); in gaiaShpAnalyze()
4837 y = gaiaImport64 (shp->BufShp + base + in gaiaShpAnalyze()
4840 shp->endian_arch); in gaiaShpAnalyze()
4871 if (shp->memShp != NULL) in gaiaShpAnalyze()
4872 rd = gaiaMemRead (shp->BufShp, 32, shp->memShp); in gaiaShpAnalyze()
4874 rd = fread (shp->BufShp, sizeof (unsigned char), 32, in gaiaShpAnalyze()
4875 shp->flShp); in gaiaShpAnalyze()
4878 if (shp->memShp != NULL) in gaiaShpAnalyze()
4879 rd = gaiaMemRead (shp->BufShp, (sz * 2) - 36, shp->memShp); in gaiaShpAnalyze()
4881 rd = fread (shp->BufShp, sizeof (unsigned char), in gaiaShpAnalyze()
4882 (sz * 2) - 36, shp->flShp); in gaiaShpAnalyze()
4885 n = gaiaImport32 (shp->BufShp, GAIA_LITTLE_ENDIAN, in gaiaShpAnalyze()
4886 shp->endian_arch); in gaiaShpAnalyze()
4896 if (shp->LastError) in gaiaShpAnalyze()
4897 free (shp->LastError); in gaiaShpAnalyze()
4898 shp->LastError = NULL; in gaiaShpAnalyze()
4900 if (shp->Shape == GAIA_SHP_POLYLINE || shp->Shape == GAIA_SHP_POLYLINEZ in gaiaShpAnalyze()
4901 || shp->Shape == GAIA_SHP_POLYLINEM) in gaiaShpAnalyze()
4905 shp->EffectiveType = GAIA_MULTILINESTRING; in gaiaShpAnalyze()
4907 shp->EffectiveType = GAIA_LINESTRING; in gaiaShpAnalyze()
4909 if (shp->Shape == GAIA_SHP_POLYGON || shp->Shape == GAIA_SHP_POLYGONZ in gaiaShpAnalyze()
4910 || shp->Shape == GAIA_SHP_POLYGONM) in gaiaShpAnalyze()
4914 shp->EffectiveType = GAIA_MULTIPOLYGON; in gaiaShpAnalyze()
4916 shp->EffectiveType = GAIA_POLYGON; in gaiaShpAnalyze()
4918 if (shp->Shape == GAIA_SHP_POLYLINEZ || shp->Shape == GAIA_SHP_POLYGONZ in gaiaShpAnalyze()
4919 || shp->Shape == GAIA_SHP_MULTIPOINTZ) in gaiaShpAnalyze()
4922 shp->EffectiveDims = GAIA_XY_Z_M; in gaiaShpAnalyze()
4924 shp->EffectiveDims = GAIA_XY_Z; in gaiaShpAnalyze()