[postgis-tickets] [SCM] PostGIS branch master updated. 3.2.0-811-ge9716f59d
git at osgeo.org
git at osgeo.org
Sun May 8 12:58:41 PDT 2022
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".
The branch, master has been updated
via e9716f59dcd2cfb9f8ff83a08c67dc14ac22f26d (commit)
from ca08baecaaeec991fa1186fee2254e85402d7d48 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit e9716f59dcd2cfb9f8ff83a08c67dc14ac22f26d
Author: Björn Harrtell <bjorn at wololo.org>
Date: Sun May 8 21:58:25 2022 +0200
Fix whitespace
diff --git a/deps/flatgeobuf/flatgeobuf_c.cpp b/deps/flatgeobuf/flatgeobuf_c.cpp
index bf9b8251e..ad5c40c76 100644
--- a/deps/flatgeobuf/flatgeobuf_c.cpp
+++ b/deps/flatgeobuf/flatgeobuf_c.cpp
@@ -37,284 +37,284 @@ uint8_t flatgeobuf_magicbytes[] = { 0x66, 0x67, 0x62, 0x03, 0x66, 0x67, 0x62, 0x
uint8_t FLATGEOBUF_MAGICBYTES_SIZE = sizeof(flatgeobuf_magicbytes);
struct FeatureItem : FlatGeobuf::Item {
- uoffset_t size;
- uint64_t offset;
+ uoffset_t size;
+ uint64_t offset;
};
int flatgeobuf_encode_header(ctx *ctx)
{
- FlatBufferBuilder fbb;
- fbb.TrackMinAlign(8);
+ FlatBufferBuilder fbb;
+ fbb.TrackMinAlign(8);
- // inspect first geometry
+ // inspect first geometry
if (ctx->lwgeom != NULL) {
- if (lwgeom_has_srid(ctx->lwgeom))
- ctx->srid = ctx->lwgeom->srid;
+ if (lwgeom_has_srid(ctx->lwgeom))
+ ctx->srid = ctx->lwgeom->srid;
ctx->has_z = lwgeom_has_z(ctx->lwgeom);
ctx->has_m = lwgeom_has_m(ctx->lwgeom);
- ctx->lwgeom_type = ctx->lwgeom->type;
+ ctx->lwgeom_type = ctx->lwgeom->type;
ctx->geometry_type = (uint8_t) GeometryWriter::get_geometrytype(ctx->lwgeom);
} else {
LWDEBUG(2, "ctx->lwgeom is null");
ctx->geometry_type = 0;
}
- LWDEBUGF(2, "ctx->geometry_type %d", ctx->geometry_type);
-
- std::vector<flatbuffers::Offset<FlatGeobuf::Column>> columns;
- std::vector<flatbuffers::Offset<FlatGeobuf::Column>> *pColumns = nullptr;
-
- if (ctx->columns_size > 0) {
- for (uint16_t i = 0; i < ctx->columns_size; i++) {
- auto c = ctx->columns[i];
- columns.push_back(CreateColumnDirect(fbb, c->name, (ColumnType) c->type));
- }
- }
- if (columns.size() > 0)
- pColumns = &columns;
-
- flatbuffers::Offset<Crs> crs = 0;
- if (ctx->srid > 0)
- crs = CreateCrsDirect(fbb, nullptr, ctx->srid);
-
- std::vector<double> envelope;
- std::vector<double> *pEnvelope = nullptr;
- if (ctx->has_extent) {
- envelope.push_back(ctx->xmin);
- envelope.push_back(ctx->ymin);
- envelope.push_back(ctx->xmax);
- envelope.push_back(ctx->ymax);
- }
- if (envelope.size() > 0)
- pEnvelope = &envelope;
-
- const auto header = CreateHeaderDirect(
- fbb, ctx->name, pEnvelope, (GeometryType) ctx->geometry_type, ctx->has_z, ctx->has_m, ctx->has_t, ctx->has_tm, pColumns, ctx->features_count, ctx->index_node_size, crs);
- fbb.FinishSizePrefixed(header);
- const auto buffer = fbb.GetBufferPointer();
- const auto size = fbb.GetSize();
-
- LWDEBUGF(2, "header size %d (with size prefix)", size);
-
- Verifier verifier(buffer, size - sizeof(uoffset_t));
- if (VerifySizePrefixedHeaderBuffer(verifier)) {
- lwerror("buffer did not pass verification");
- return -1;
- }
-
- ctx->buf = (uint8_t *) lwrealloc(ctx->buf, ctx->offset + size);
+ LWDEBUGF(2, "ctx->geometry_type %d", ctx->geometry_type);
+
+ std::vector<flatbuffers::Offset<FlatGeobuf::Column>> columns;
+ std::vector<flatbuffers::Offset<FlatGeobuf::Column>> *pColumns = nullptr;
+
+ if (ctx->columns_size > 0) {
+ for (uint16_t i = 0; i < ctx->columns_size; i++) {
+ auto c = ctx->columns[i];
+ columns.push_back(CreateColumnDirect(fbb, c->name, (ColumnType) c->type));
+ }
+ }
+ if (columns.size() > 0)
+ pColumns = &columns;
+
+ flatbuffers::Offset<Crs> crs = 0;
+ if (ctx->srid > 0)
+ crs = CreateCrsDirect(fbb, nullptr, ctx->srid);
+
+ std::vector<double> envelope;
+ std::vector<double> *pEnvelope = nullptr;
+ if (ctx->has_extent) {
+ envelope.push_back(ctx->xmin);
+ envelope.push_back(ctx->ymin);
+ envelope.push_back(ctx->xmax);
+ envelope.push_back(ctx->ymax);
+ }
+ if (envelope.size() > 0)
+ pEnvelope = &envelope;
+
+ const auto header = CreateHeaderDirect(
+ fbb, ctx->name, pEnvelope, (GeometryType) ctx->geometry_type, ctx->has_z, ctx->has_m, ctx->has_t, ctx->has_tm, pColumns, ctx->features_count, ctx->index_node_size, crs);
+ fbb.FinishSizePrefixed(header);
+ const auto buffer = fbb.GetBufferPointer();
+ const auto size = fbb.GetSize();
+
+ LWDEBUGF(2, "header size %d (with size prefix)", size);
+
+ Verifier verifier(buffer, size - sizeof(uoffset_t));
+ if (VerifySizePrefixedHeaderBuffer(verifier)) {
+ lwerror("buffer did not pass verification");
+ return -1;
+ }
+
+ ctx->buf = (uint8_t *) lwrealloc(ctx->buf, ctx->offset + size);
LWDEBUGF(2, "copying to ctx->buf at offset %ld", ctx->offset);
memcpy(ctx->buf + ctx->offset, buffer, size);
ctx->offset += size;
- return 0;
+ return 0;
}
int flatgeobuf_encode_feature(ctx *ctx)
{
- FlatBufferBuilder fbb;
- Offset<Geometry> geometry = 0;
- Offset<Vector<uint8_t>> properties = 0;
-
- fbb.TrackMinAlign(8);
-
- if (ctx->lwgeom != NULL && !lwgeom_is_empty(ctx->lwgeom)) {
- LWDEBUGG(3, ctx->lwgeom, "GeometryWriter input LWGEOM");
- if (ctx->lwgeom_type != ctx->lwgeom->type) {
- lwerror("mixed geometry type is not supported");
- return -1;
- }
- GeometryWriter writer(fbb, ctx->lwgeom, (GeometryType) ctx->geometry_type, ctx->has_z, ctx->has_m);
- geometry = writer.write(0);
- }
- if (ctx->properties_len > 0)
- properties = fbb.CreateVector<uint8_t>(ctx->properties, ctx->properties_len);
- FeatureBuilder builder(fbb);
- builder.add_geometry(geometry);
- builder.add_properties(properties);
- auto feature = builder.Finish();
- fbb.FinishSizePrefixed(feature);
- const auto buffer = fbb.GetBufferPointer();
- const auto size = fbb.GetSize();
-
- LWDEBUGF(3, "encode_feature size %ld", size);
-
- Verifier verifier(buffer, size - sizeof(uoffset_t));
- if (VerifySizePrefixedFeatureBuffer(verifier)) {
- lwerror("buffer did not pass verification");
- return -1;
- }
+ FlatBufferBuilder fbb;
+ Offset<Geometry> geometry = 0;
+ Offset<Vector<uint8_t>> properties = 0;
+
+ fbb.TrackMinAlign(8);
+
+ if (ctx->lwgeom != NULL && !lwgeom_is_empty(ctx->lwgeom)) {
+ LWDEBUGG(3, ctx->lwgeom, "GeometryWriter input LWGEOM");
+ if (ctx->lwgeom_type != ctx->lwgeom->type) {
+ lwerror("mixed geometry type is not supported");
+ return -1;
+ }
+ GeometryWriter writer(fbb, ctx->lwgeom, (GeometryType) ctx->geometry_type, ctx->has_z, ctx->has_m);
+ geometry = writer.write(0);
+ }
+ if (ctx->properties_len > 0)
+ properties = fbb.CreateVector<uint8_t>(ctx->properties, ctx->properties_len);
+ FeatureBuilder builder(fbb);
+ builder.add_geometry(geometry);
+ builder.add_properties(properties);
+ auto feature = builder.Finish();
+ fbb.FinishSizePrefixed(feature);
+ const auto buffer = fbb.GetBufferPointer();
+ const auto size = fbb.GetSize();
+
+ LWDEBUGF(3, "encode_feature size %ld", size);
+
+ Verifier verifier(buffer, size - sizeof(uoffset_t));
+ if (VerifySizePrefixedFeatureBuffer(verifier)) {
+ lwerror("buffer did not pass verification");
+ return -1;
+ }
LWDEBUGF(3, "reallocating ctx->buf to size %ld", ctx->offset + size);
ctx->buf = (uint8_t * ) lwrealloc(ctx->buf, ctx->offset + size);
LWDEBUGF(3, "copying feature to ctx->buf at offset %ld", ctx->offset);
memcpy(ctx->buf + ctx->offset, buffer, size);
- if (ctx->create_index) {
- auto item = (flatgeobuf_item *) lwalloc(sizeof(flatgeobuf_item));
- memset(item, 0, sizeof(flatgeobuf_item));
- if (ctx->lwgeom != NULL && !lwgeom_is_empty(ctx->lwgeom)) {
- auto gbox = lwgeom_get_bbox(ctx->lwgeom);
- item->xmin = gbox->xmin;
- item->xmax = gbox->xmax;
- item->ymin = gbox->ymin;
- item->ymax = gbox->ymax;
- }
- item->offset = ctx->offset;
- item->size = size;
- ctx->items[ctx->features_count] = item;
- }
- ctx->offset += size;
+ if (ctx->create_index) {
+ auto item = (flatgeobuf_item *) lwalloc(sizeof(flatgeobuf_item));
+ memset(item, 0, sizeof(flatgeobuf_item));
+ if (ctx->lwgeom != NULL && !lwgeom_is_empty(ctx->lwgeom)) {
+ auto gbox = lwgeom_get_bbox(ctx->lwgeom);
+ item->xmin = gbox->xmin;
+ item->xmax = gbox->xmax;
+ item->ymin = gbox->ymin;
+ item->ymax = gbox->ymax;
+ }
+ item->offset = ctx->offset;
+ item->size = size;
+ ctx->items[ctx->features_count] = item;
+ }
+ ctx->offset += size;
ctx->features_count++;
- return 0;
+ return 0;
}
void flatgeobuf_create_index(ctx *ctx)
{
- // convert to structure expected by packedrtree
- std::vector<std::shared_ptr<Item>> items;
- for (uint64_t i = 0; i < ctx->features_count; i++) {
- const auto item = std::make_shared<FeatureItem>();
- item->nodeItem = {
- ctx->items[i]->xmin, ctx->items[i]->ymin, ctx->items[i]->xmax, ctx->items[i]->ymax
- };
- item->offset = ctx->items[i]->offset;
- item->size = ctx->items[i]->size;
- items.push_back(item);
- }
- // sort items
- hilbertSort(items);
- // calc extent
- auto extent = calcExtent(items);
- ctx->has_extent = true;
- ctx->xmin = extent.minX;
- ctx->ymin = extent.minY;
- ctx->xmax = extent.maxX;
- ctx->ymax = extent.maxY;
- // allocate new buffer and write magicbytes
- auto oldbuf = ctx->buf;
- auto oldoffset = ctx->offset;
- ctx->buf = (uint8_t *) lwalloc(sizeof(signed int) + FLATGEOBUF_MAGICBYTES_SIZE);
- memcpy(ctx->buf + sizeof(signed int), flatgeobuf_magicbytes, FLATGEOBUF_MAGICBYTES_SIZE);
- ctx->offset = sizeof(signed int) + FLATGEOBUF_MAGICBYTES_SIZE;
- // write new header
- flatgeobuf_encode_header(ctx);
- // calculate new offsets
- uint64_t featureOffset = 0;
- for (auto item : items) {
- auto featureItem = std::static_pointer_cast<FeatureItem>(item);
- featureItem->nodeItem.offset = featureOffset;
- featureOffset += featureItem->size;
- }
- // create and write index
- PackedRTree tree(items, extent, ctx->index_node_size);
- const auto writeData = [&ctx] (const void *data, const size_t size) {
- ctx->buf = (uint8_t *) lwrealloc(ctx->buf, ctx->offset + size);
- memcpy(ctx->buf + ctx->offset, data, size);
- ctx->offset += size;
- };
- tree.streamWrite(writeData);
- // read items and write in sorted order
- for (auto item : items) {
- auto featureItem = std::static_pointer_cast<FeatureItem>(item);
- ctx->buf = (uint8_t *) lwrealloc(ctx->buf, ctx->offset + featureItem->size);
- LWDEBUGF(2, "copy from offset %ld", featureItem->offset);
- memcpy(ctx->buf + ctx->offset, oldbuf + featureItem->offset, featureItem->size);
- ctx->offset += featureItem->size;
- }
- lwfree(oldbuf);
+ // convert to structure expected by packedrtree
+ std::vector<std::shared_ptr<Item>> items;
+ for (uint64_t i = 0; i < ctx->features_count; i++) {
+ const auto item = std::make_shared<FeatureItem>();
+ item->nodeItem = {
+ ctx->items[i]->xmin, ctx->items[i]->ymin, ctx->items[i]->xmax, ctx->items[i]->ymax
+ };
+ item->offset = ctx->items[i]->offset;
+ item->size = ctx->items[i]->size;
+ items.push_back(item);
+ }
+ // sort items
+ hilbertSort(items);
+ // calc extent
+ auto extent = calcExtent(items);
+ ctx->has_extent = true;
+ ctx->xmin = extent.minX;
+ ctx->ymin = extent.minY;
+ ctx->xmax = extent.maxX;
+ ctx->ymax = extent.maxY;
+ // allocate new buffer and write magicbytes
+ auto oldbuf = ctx->buf;
+ auto oldoffset = ctx->offset;
+ ctx->buf = (uint8_t *) lwalloc(sizeof(signed int) + FLATGEOBUF_MAGICBYTES_SIZE);
+ memcpy(ctx->buf + sizeof(signed int), flatgeobuf_magicbytes, FLATGEOBUF_MAGICBYTES_SIZE);
+ ctx->offset = sizeof(signed int) + FLATGEOBUF_MAGICBYTES_SIZE;
+ // write new header
+ flatgeobuf_encode_header(ctx);
+ // calculate new offsets
+ uint64_t featureOffset = 0;
+ for (auto item : items) {
+ auto featureItem = std::static_pointer_cast<FeatureItem>(item);
+ featureItem->nodeItem.offset = featureOffset;
+ featureOffset += featureItem->size;
+ }
+ // create and write index
+ PackedRTree tree(items, extent, ctx->index_node_size);
+ const auto writeData = [&ctx] (const void *data, const size_t size) {
+ ctx->buf = (uint8_t *) lwrealloc(ctx->buf, ctx->offset + size);
+ memcpy(ctx->buf + ctx->offset, data, size);
+ ctx->offset += size;
+ };
+ tree.streamWrite(writeData);
+ // read items and write in sorted order
+ for (auto item : items) {
+ auto featureItem = std::static_pointer_cast<FeatureItem>(item);
+ ctx->buf = (uint8_t *) lwrealloc(ctx->buf, ctx->offset + featureItem->size);
+ LWDEBUGF(2, "copy from offset %ld", featureItem->offset);
+ memcpy(ctx->buf + ctx->offset, oldbuf + featureItem->offset, featureItem->size);
+ ctx->offset += featureItem->size;
+ }
+ lwfree(oldbuf);
}
int flatgeobuf_decode_feature(ctx *ctx)
{
- LWDEBUGF(2, "reading size prefix at %ld", ctx->offset);
- auto size = flatbuffers::GetPrefixedSize(ctx->buf + ctx->offset);
+ LWDEBUGF(2, "reading size prefix at %ld", ctx->offset);
+ auto size = flatbuffers::GetPrefixedSize(ctx->buf + ctx->offset);
LWDEBUGF(2, "size is %ld (without size prefix)", size);
- Verifier verifier(ctx->buf + ctx->offset, size);
+ Verifier verifier(ctx->buf + ctx->offset, size);
if (VerifySizePrefixedFeatureBuffer(verifier)) {
- lwerror("buffer did not pass verification");
- return -1;
- }
-
- ctx->offset += sizeof(uoffset_t);
-
- auto feature = GetFeature(ctx->buf + ctx->offset);
- ctx->offset += size;
-
- const auto geometry = feature->geometry();
- if (geometry != nullptr) {
- LWDEBUGF(3, "Constructing GeometryReader with geometry_type %d has_z %d haz_m %d", ctx->geometry_type, ctx->has_z, ctx->has_m);
- GeometryReader reader(geometry, (GeometryType) ctx->geometry_type, ctx->has_z, ctx->has_m);
- ctx->lwgeom = reader.read();
- if (ctx->srid > 0)
- lwgeom_set_srid(ctx->lwgeom, ctx->srid);
- LWDEBUGG(3, ctx->lwgeom, "GeometryReader output LWGEOM");
- } else {
- ctx->lwgeom = NULL;
- }
- if (feature->properties() != nullptr && feature->properties()->size() != 0) {
- ctx->properties = (uint8_t *) feature->properties()->data();
- ctx->properties_len = feature->properties()->size();
- } else {
- ctx->properties_len = 0;
- }
-
- return 0;
+ lwerror("buffer did not pass verification");
+ return -1;
+ }
+
+ ctx->offset += sizeof(uoffset_t);
+
+ auto feature = GetFeature(ctx->buf + ctx->offset);
+ ctx->offset += size;
+
+ const auto geometry = feature->geometry();
+ if (geometry != nullptr) {
+ LWDEBUGF(3, "Constructing GeometryReader with geometry_type %d has_z %d haz_m %d", ctx->geometry_type, ctx->has_z, ctx->has_m);
+ GeometryReader reader(geometry, (GeometryType) ctx->geometry_type, ctx->has_z, ctx->has_m);
+ ctx->lwgeom = reader.read();
+ if (ctx->srid > 0)
+ lwgeom_set_srid(ctx->lwgeom, ctx->srid);
+ LWDEBUGG(3, ctx->lwgeom, "GeometryReader output LWGEOM");
+ } else {
+ ctx->lwgeom = NULL;
+ }
+ if (feature->properties() != nullptr && feature->properties()->size() != 0) {
+ ctx->properties = (uint8_t *) feature->properties()->data();
+ ctx->properties_len = feature->properties()->size();
+ } else {
+ ctx->properties_len = 0;
+ }
+
+ return 0;
}
int flatgeobuf_decode_header(ctx *ctx)
{
- LWDEBUGF(2, "reading size prefix at %ld", ctx->offset);
- auto size = flatbuffers::GetPrefixedSize(ctx->buf + ctx->offset);
+ LWDEBUGF(2, "reading size prefix at %ld", ctx->offset);
+ auto size = flatbuffers::GetPrefixedSize(ctx->buf + ctx->offset);
LWDEBUGF(2, "size is %ld (without size prefix)", size);
- Verifier verifier(ctx->buf + ctx->offset, size);
+ Verifier verifier(ctx->buf + ctx->offset, size);
if (VerifySizePrefixedHeaderBuffer(verifier)) {
- lwerror("buffer did not pass verification");
- return -1;
- }
+ lwerror("buffer did not pass verification");
+ return -1;
+ }
- ctx->offset += sizeof(uoffset_t);
+ ctx->offset += sizeof(uoffset_t);
- LWDEBUGF(2, "reading header at %ld with size %ld", ctx->offset, size);
- auto header = GetHeader(ctx->buf + ctx->offset);
+ LWDEBUGF(2, "reading header at %ld with size %ld", ctx->offset, size);
+ auto header = GetHeader(ctx->buf + ctx->offset);
ctx->offset += size;
ctx->geometry_type = (uint8_t) header->geometry_type();
- ctx->features_count = header->features_count();
+ ctx->features_count = header->features_count();
ctx->has_z = header->has_z();
- ctx->has_m = header->has_m();
- ctx->has_t = header->has_t();
- ctx->has_tm = header->has_tm();
- ctx->index_node_size = header->index_node_size();
- auto crs = header->crs();
- if (crs != nullptr)
- ctx->srid = crs->code();
- auto columns = header->columns();
- if (columns != nullptr) {
- auto size = columns->size();
- ctx->columns = (flatgeobuf_column **) lwalloc(sizeof(flatgeobuf_column *) * size);
- ctx->columns_size = size;
- for (uint32_t i = 0; i < size; i++) {
- auto column = columns->Get(i);
- ctx->columns[i] = (flatgeobuf_column *) lwalloc(sizeof(flatgeobuf_column));
- memset(ctx->columns[i], 0, sizeof(flatgeobuf_column));
- ctx->columns[i]->name = column->name()->c_str();
- ctx->columns[i]->type = (uint8_t) column->type();
- }
- }
+ ctx->has_m = header->has_m();
+ ctx->has_t = header->has_t();
+ ctx->has_tm = header->has_tm();
+ ctx->index_node_size = header->index_node_size();
+ auto crs = header->crs();
+ if (crs != nullptr)
+ ctx->srid = crs->code();
+ auto columns = header->columns();
+ if (columns != nullptr) {
+ auto size = columns->size();
+ ctx->columns = (flatgeobuf_column **) lwalloc(sizeof(flatgeobuf_column *) * size);
+ ctx->columns_size = size;
+ for (uint32_t i = 0; i < size; i++) {
+ auto column = columns->Get(i);
+ ctx->columns[i] = (flatgeobuf_column *) lwalloc(sizeof(flatgeobuf_column));
+ memset(ctx->columns[i], 0, sizeof(flatgeobuf_column));
+ ctx->columns[i]->name = column->name()->c_str();
+ ctx->columns[i]->type = (uint8_t) column->type();
+ }
+ }
LWDEBUGF(2, "ctx->geometry_type: %d", ctx->geometry_type);
LWDEBUGF(2, "ctx->columns_len: %d", ctx->columns_size);
- if (ctx->index_node_size > 0 && ctx->features_count > 0) {
- auto treeSize = PackedRTree::size(ctx->features_count, ctx->index_node_size);
- LWDEBUGF(2, "Adding tree size %ld to offset", treeSize);
- ctx->offset += treeSize;
- }
+ if (ctx->index_node_size > 0 && ctx->features_count > 0) {
+ auto treeSize = PackedRTree::size(ctx->features_count, ctx->index_node_size);
+ LWDEBUGF(2, "Adding tree size %ld to offset", treeSize);
+ ctx->offset += treeSize;
+ }
- return 0;
+ return 0;
}
\ No newline at end of file
diff --git a/deps/flatgeobuf/flatgeobuf_c.h b/deps/flatgeobuf/flatgeobuf_c.h
index 89046c207..ac94967f3 100644
--- a/deps/flatgeobuf/flatgeobuf_c.h
+++ b/deps/flatgeobuf/flatgeobuf_c.h
@@ -79,7 +79,7 @@ typedef struct flatgeobuf_item
typedef struct flatgeobuf_ctx
{
- // header contents
+ // header contents
const char *name;
uint64_t features_count;
uint8_t geometry_type;
@@ -97,19 +97,19 @@ typedef struct flatgeobuf_ctx
flatgeobuf_column **columns;
uint16_t columns_size;
- // encode/decode buffers
+ // encode/decode buffers
uint8_t *buf;
uint64_t offset;
- uint64_t size;
+ uint64_t size;
- LWGEOM *lwgeom;
+ LWGEOM *lwgeom;
uint8_t lwgeom_type;
- uint8_t *properties;
+ uint8_t *properties;
uint32_t properties_len;
- uint32_t properties_size;
+ uint32_t properties_size;
- // encode input
- const char *geom_name;
+ // encode input
+ const char *geom_name;
uint32_t geom_index;
// encode spatial index bookkeeping
diff --git a/deps/flatgeobuf/geometryreader.cpp b/deps/flatgeobuf/geometryreader.cpp
index 4ed92021f..06f30b1f1 100644
--- a/deps/flatgeobuf/geometryreader.cpp
+++ b/deps/flatgeobuf/geometryreader.cpp
@@ -29,177 +29,177 @@ using namespace FlatGeobuf;
LWPOINT *GeometryReader::readPoint()
{
- POINTARRAY *pa;
+ POINTARRAY *pa;
POINT4D pt;
- pa = ptarray_construct_empty(m_has_z, m_has_m, 1);
+ pa = ptarray_construct_empty(m_has_z, m_has_m, 1);
- if (m_geometry->xy() == nullptr || m_geometry->xy()->size() == 0) {
- return lwpoint_construct(0, NULL, pa);
- }
+ if (m_geometry->xy() == nullptr || m_geometry->xy()->size() == 0) {
+ return lwpoint_construct(0, NULL, pa);
+ }
const auto xy = m_geometry->xy()->data();
double x = xy[m_offset + 0];
double y = xy[m_offset + 1];
- double z = 0;
- double m = 0;
+ double z = 0;
+ double m = 0;
- if (m_has_z)
- z = m_geometry->z()->data()[m_offset];
- if (m_has_m)
- m = m_geometry->m()->data()[m_offset];
+ if (m_has_z)
+ z = m_geometry->z()->data()[m_offset];
+ if (m_has_m)
+ m = m_geometry->m()->data()[m_offset];
- pt = (POINT4D) { x, y, z, m };
+ pt = (POINT4D) { x, y, z, m };
ptarray_append_point(pa, &pt, LW_TRUE);
return lwpoint_construct(0, NULL, pa);
}
POINTARRAY *GeometryReader::readPA()
{
- POINTARRAY *pa;
+ POINTARRAY *pa;
POINT4D pt;
uint32_t npoints;
- const double *xy = m_geometry->xy()->data();
- const double *z = m_has_z ? m_geometry->z()->data() : nullptr;
- const double *m = m_has_m ? m_geometry->m()->data() : nullptr;
+ const double *xy = m_geometry->xy()->data();
+ const double *z = m_has_z ? m_geometry->z()->data() : nullptr;
+ const double *m = m_has_m ? m_geometry->m()->data() : nullptr;
pa = ptarray_construct_empty(m_has_z, m_has_m, m_length);
- for (uint32_t i = m_offset; i < m_offset + m_length; i++) {
- double xv = xy[i * 2 + 0];
- double yv = xy[i * 2 + 1];
- double zv = 0;
- double mv = 0;
- if (m_has_z)
- zv = z[i];
- if (m_has_m)
- mv = m[i];
- pt = (POINT4D) { xv, yv, zv, mv };
- ptarray_append_point(pa, &pt, LW_TRUE);
- }
+ for (uint32_t i = m_offset; i < m_offset + m_length; i++) {
+ double xv = xy[i * 2 + 0];
+ double yv = xy[i * 2 + 1];
+ double zv = 0;
+ double mv = 0;
+ if (m_has_z)
+ zv = z[i];
+ if (m_has_m)
+ mv = m[i];
+ pt = (POINT4D) { xv, yv, zv, mv };
+ ptarray_append_point(pa, &pt, LW_TRUE);
+ }
return pa;
}
LWMPOINT *GeometryReader::readMultiPoint()
{
- POINTARRAY *pa = readPA();
+ POINTARRAY *pa = readPA();
return lwmpoint_construct(0, pa);
}
LWLINE *GeometryReader::readLineString()
{
- POINTARRAY *pa = readPA();
+ POINTARRAY *pa = readPA();
return lwline_construct(0, NULL, pa);
}
LWMLINE *GeometryReader::readMultiLineString()
{
- auto ends = m_geometry->ends();
+ auto ends = m_geometry->ends();
- uint32_t ngeoms = 1;
- if (ends != nullptr && ends->size() > 1)
+ uint32_t ngeoms = 1;
+ if (ends != nullptr && ends->size() > 1)
ngeoms = ends->size();
- auto *lwmline = lwmline_construct_empty(0, m_has_z, m_has_m);
- if (ngeoms > 1) {
- for (uint32_t i = 0; i < ngeoms; i++) {
+ auto *lwmline = lwmline_construct_empty(0, m_has_z, m_has_m);
+ if (ngeoms > 1) {
+ for (uint32_t i = 0; i < ngeoms; i++) {
const auto e = ends->Get(i);
m_length = e - m_offset;
POINTARRAY *pa = readPA();
lwmline_add_lwline(lwmline, lwline_construct(0, NULL, pa));
m_offset = e;
}
- } else {
- POINTARRAY *pa = readPA();
+ } else {
+ POINTARRAY *pa = readPA();
lwmline_add_lwline(lwmline, lwline_construct(0, NULL, pa));
- }
+ }
- return lwmline;
+ return lwmline;
}
LWPOLY *GeometryReader::readPolygon()
{
- const auto ends = m_geometry->ends();
-
- uint32_t nrings = 1;
- if (ends != nullptr && ends->size() > 1)
- nrings = ends->size();
-
- auto **ppa = (POINTARRAY **) lwalloc(sizeof(POINTARRAY *) * nrings);
- if (nrings > 1) {
- for (uint32_t i = 0; i < nrings; i++) {
- const auto e = ends->Get(i);
- m_length = e - m_offset;
- ppa[i] = readPA();
- m_offset = e;
- }
- } else {
- ppa[0] = readPA();
- }
-
- return lwpoly_construct(0, NULL, nrings, ppa);
+ const auto ends = m_geometry->ends();
+
+ uint32_t nrings = 1;
+ if (ends != nullptr && ends->size() > 1)
+ nrings = ends->size();
+
+ auto **ppa = (POINTARRAY **) lwalloc(sizeof(POINTARRAY *) * nrings);
+ if (nrings > 1) {
+ for (uint32_t i = 0; i < nrings; i++) {
+ const auto e = ends->Get(i);
+ m_length = e - m_offset;
+ ppa[i] = readPA();
+ m_offset = e;
+ }
+ } else {
+ ppa[0] = readPA();
+ }
+
+ return lwpoly_construct(0, NULL, nrings, ppa);
}
LWMPOLY *GeometryReader::readMultiPolygon()
{
- auto parts = m_geometry->parts();
- auto *mp = lwmpoly_construct_empty(0, m_has_z, m_has_m);
- for (uoffset_t i = 0; i < parts->size(); i++) {
- GeometryReader reader { parts->Get(i), GeometryType::Polygon, m_has_z, m_has_m };
- const auto p = (LWPOLY *) reader.read();
- lwmpoly_add_lwpoly(mp, p);
- }
- return mp;
+ auto parts = m_geometry->parts();
+ auto *mp = lwmpoly_construct_empty(0, m_has_z, m_has_m);
+ for (uoffset_t i = 0; i < parts->size(); i++) {
+ GeometryReader reader { parts->Get(i), GeometryType::Polygon, m_has_z, m_has_m };
+ const auto p = (LWPOLY *) reader.read();
+ lwmpoly_add_lwpoly(mp, p);
+ }
+ return mp;
}
LWCOLLECTION *GeometryReader::readGeometryCollection()
{
- auto parts = m_geometry->parts();
- auto *gc = lwcollection_construct_empty(COLLECTIONTYPE, 0, m_has_z, m_has_m);
- for (uoffset_t i = 0; i < parts->size(); i++) {
- auto part = parts->Get(i);
- GeometryReader reader { part, part->type(), m_has_z, m_has_m };
- const auto g = reader.read();
- lwcollection_add_lwgeom(gc, g);
- }
- return gc;
+ auto parts = m_geometry->parts();
+ auto *gc = lwcollection_construct_empty(COLLECTIONTYPE, 0, m_has_z, m_has_m);
+ for (uoffset_t i = 0; i < parts->size(); i++) {
+ auto part = parts->Get(i);
+ GeometryReader reader { part, part->type(), m_has_z, m_has_m };
+ const auto g = reader.read();
+ lwcollection_add_lwgeom(gc, g);
+ }
+ return gc;
}
LWGEOM *GeometryReader::read()
{
- // nested types
- switch (m_geometry_type) {
- case GeometryType::GeometryCollection: return (LWGEOM *) readGeometryCollection();
- case GeometryType::MultiPolygon: return (LWGEOM *) readMultiPolygon();
- /*case GeometryType::CompoundCurve: return readCompoundCurve();
- case GeometryType::CurvePolygon: return readCurvePolygon();
- case GeometryType::MultiCurve: return readMultiCurve();
- case GeometryType::MultiSurface: return readMultiSurface();
- case GeometryType::PolyhedralSurface: return readPolyhedralSurface();*/
- default: break;
- }
-
- // if not nested must have geometry data
- const auto pXy = m_geometry->xy();
- const auto xySize = pXy->size();
- m_length = xySize / 2;
-
- switch (m_geometry_type) {
- case GeometryType::Point: return (LWGEOM *) readPoint();
- case GeometryType::MultiPoint: return (LWGEOM *) readMultiPoint();
- case GeometryType::LineString: return (LWGEOM *) readLineString();
- case GeometryType::MultiLineString: return (LWGEOM *) readMultiLineString();
- case GeometryType::Polygon: return (LWGEOM *) readPolygon();
- /*
- case GeometryType::CircularString: return readSimpleCurve<OGRCircularString>(true);
- case GeometryType::Triangle: return readTriangle();
- case GeometryType::TIN: return readTIN();
- */
- default:
- lwerror("flatgeobuf: GeometryReader::read: Unknown type %d", (int) m_geometry_type);
- }
- return nullptr;
+ // nested types
+ switch (m_geometry_type) {
+ case GeometryType::GeometryCollection: return (LWGEOM *) readGeometryCollection();
+ case GeometryType::MultiPolygon: return (LWGEOM *) readMultiPolygon();
+ /*case GeometryType::CompoundCurve: return readCompoundCurve();
+ case GeometryType::CurvePolygon: return readCurvePolygon();
+ case GeometryType::MultiCurve: return readMultiCurve();
+ case GeometryType::MultiSurface: return readMultiSurface();
+ case GeometryType::PolyhedralSurface: return readPolyhedralSurface();*/
+ default: break;
+ }
+
+ // if not nested must have geometry data
+ const auto pXy = m_geometry->xy();
+ const auto xySize = pXy->size();
+ m_length = xySize / 2;
+
+ switch (m_geometry_type) {
+ case GeometryType::Point: return (LWGEOM *) readPoint();
+ case GeometryType::MultiPoint: return (LWGEOM *) readMultiPoint();
+ case GeometryType::LineString: return (LWGEOM *) readLineString();
+ case GeometryType::MultiLineString: return (LWGEOM *) readMultiLineString();
+ case GeometryType::Polygon: return (LWGEOM *) readPolygon();
+ /*
+ case GeometryType::CircularString: return readSimpleCurve<OGRCircularString>(true);
+ case GeometryType::Triangle: return readTriangle();
+ case GeometryType::TIN: return readTIN();
+ */
+ default:
+ lwerror("flatgeobuf: GeometryReader::read: Unknown type %d", (int) m_geometry_type);
+ }
+ return nullptr;
}
\ No newline at end of file
diff --git a/deps/flatgeobuf/geometryreader.h b/deps/flatgeobuf/geometryreader.h
index 0fd8c93e5..c2d7b4a29 100644
--- a/deps/flatgeobuf/geometryreader.h
+++ b/deps/flatgeobuf/geometryreader.h
@@ -41,37 +41,37 @@ extern "C" {
namespace FlatGeobuf {
class GeometryReader {
- private:
- const FlatGeobuf::Geometry *m_geometry;
- FlatGeobuf::GeometryType m_geometry_type;
- bool m_has_z;
- bool m_has_m;
+ private:
+ const FlatGeobuf::Geometry *m_geometry;
+ FlatGeobuf::GeometryType m_geometry_type;
+ bool m_has_z;
+ bool m_has_m;
- uint32_t m_length = 0;
- uint32_t m_offset = 0;
+ uint32_t m_length = 0;
+ uint32_t m_offset = 0;
- LWPOINT *readPoint();
- LWMPOINT *readMultiPoint();
- LWLINE *readLineString();
- LWMLINE *readMultiLineString();
- LWPOLY *readPolygon();
- LWMPOLY *readMultiPolygon();
- LWCOLLECTION *readGeometryCollection();
+ LWPOINT *readPoint();
+ LWMPOINT *readMultiPoint();
+ LWLINE *readLineString();
+ LWMLINE *readMultiLineString();
+ LWPOLY *readPolygon();
+ LWMPOLY *readMultiPolygon();
+ LWCOLLECTION *readGeometryCollection();
- POINTARRAY *readPA();
+ POINTARRAY *readPA();
- public:
- GeometryReader(
- const FlatGeobuf::Geometry *geometry,
- FlatGeobuf::GeometryType geometry_type,
- bool has_z,
- bool has_m) :
- m_geometry (geometry),
- m_geometry_type (geometry_type),
- m_has_z (has_z),
- m_has_m (has_m)
- { }
- LWGEOM *read();
+ public:
+ GeometryReader(
+ const FlatGeobuf::Geometry *geometry,
+ FlatGeobuf::GeometryType geometry_type,
+ bool has_z,
+ bool has_m) :
+ m_geometry (geometry),
+ m_geometry_type (geometry_type),
+ m_has_z (has_z),
+ m_has_m (has_m)
+ { }
+ LWGEOM *read();
};
}
diff --git a/deps/flatgeobuf/geometrywriter.cpp b/deps/flatgeobuf/geometrywriter.cpp
index c03241452..9c64f3adf 100644
--- a/deps/flatgeobuf/geometrywriter.cpp
+++ b/deps/flatgeobuf/geometrywriter.cpp
@@ -52,147 +52,147 @@ const GeometryType GeometryWriter::get_geometrytype(const LWGEOM *lwgeom)
default:
lwerror("flatgeobuf: get_geometrytype: '%s' geometry type not supported",
lwtype_name(type));
- return GeometryType::Unknown;
+ return GeometryType::Unknown;
}
}
void GeometryWriter::writePoint(const LWPOINT *p)
{
- writePA(p->point);
+ writePA(p->point);
}
void GeometryWriter::writeMultiPoint(const LWMPOINT *mp)
{
- writePA(lwline_from_lwmpoint(0, mp)->points);
+ writePA(lwline_from_lwmpoint(0, mp)->points);
}
void GeometryWriter::writeLineString(const LWLINE *l)
{
- writePA(l->points);
+ writePA(l->points);
}
void GeometryWriter::writeMultiLineString(const LWMLINE *ml)
{
- uint32_t ngeoms = ml->ngeoms;
- if (ngeoms == 1)
- return writePA(ml->geoms[0]->points);
- POINTARRAY **ppa = (POINTARRAY **) lwalloc(sizeof(POINTARRAY *) * ngeoms);
- for (uint32_t i = 0; i < ngeoms; i++)
- ppa[i] = ml->geoms[i]->points;
- writePPA(ppa, ngeoms);
+ uint32_t ngeoms = ml->ngeoms;
+ if (ngeoms == 1)
+ return writePA(ml->geoms[0]->points);
+ POINTARRAY **ppa = (POINTARRAY **) lwalloc(sizeof(POINTARRAY *) * ngeoms);
+ for (uint32_t i = 0; i < ngeoms; i++)
+ ppa[i] = ml->geoms[i]->points;
+ writePPA(ppa, ngeoms);
}
void GeometryWriter::writePolygon(const LWPOLY *p)
{
- writePPA(p->rings, p->nrings);
+ writePPA(p->rings, p->nrings);
}
const Offset<Geometry> GeometryWriter::writeMultiPolygon(const LWMPOLY *mp, int depth)
{
- std::vector<Offset<Geometry>> parts;
- for (uint32_t i = 0; i < mp->ngeoms; i++)
- {
- auto part = mp->geoms[i];
- if (part->nrings != 0)
- {
- GeometryWriter writer { m_fbb, (LWGEOM *) part, GeometryType::Polygon, m_has_z, m_has_m };
- parts.push_back(writer.write(depth + 1));
- }
- }
- return CreateGeometryDirect(m_fbb, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, m_geometry_type, &parts);
+ std::vector<Offset<Geometry>> parts;
+ for (uint32_t i = 0; i < mp->ngeoms; i++)
+ {
+ auto part = mp->geoms[i];
+ if (part->nrings != 0)
+ {
+ GeometryWriter writer { m_fbb, (LWGEOM *) part, GeometryType::Polygon, m_has_z, m_has_m };
+ parts.push_back(writer.write(depth + 1));
+ }
+ }
+ return CreateGeometryDirect(m_fbb, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, m_geometry_type, &parts);
}
const Offset<Geometry> GeometryWriter::writeGeometryCollection(const LWCOLLECTION *gc, int depth)
{
- std::vector<Offset<Geometry>> parts;
- for (uint32_t i = 0; i < gc->ngeoms; i++)
- {
- auto part = gc->geoms[i];
- auto geometry_type = get_geometrytype(part);
- GeometryWriter writer { m_fbb, part, geometry_type, m_has_z, m_has_m };
- parts.push_back(writer.write(depth + 1));
- }
- return CreateGeometryDirect(m_fbb, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, m_geometry_type, &parts);
+ std::vector<Offset<Geometry>> parts;
+ for (uint32_t i = 0; i < gc->ngeoms; i++)
+ {
+ auto part = gc->geoms[i];
+ auto geometry_type = get_geometrytype(part);
+ GeometryWriter writer { m_fbb, part, geometry_type, m_has_z, m_has_m };
+ parts.push_back(writer.write(depth + 1));
+ }
+ return CreateGeometryDirect(m_fbb, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, m_geometry_type, &parts);
}
void GeometryWriter::writePA(POINTARRAY *pa)
{
- POINT4D pt;
+ POINT4D pt;
for (uint32_t i = 0; i < pa->npoints; i++) {
getPoint4d_p(pa, i, &pt);
- m_xy.push_back(pt.x);
- m_xy.push_back(pt.y);
- if (m_has_z)
- m_z.push_back(pt.z);
- if (m_has_m)
- m_m.push_back(pt.m);
+ m_xy.push_back(pt.x);
+ m_xy.push_back(pt.y);
+ if (m_has_z)
+ m_z.push_back(pt.z);
+ if (m_has_m)
+ m_m.push_back(pt.m);
}
}
void GeometryWriter::writePPA(POINTARRAY **ppa, uint32_t len)
{
- if (len == 0)
- return;
- POINTARRAY *pa = ppa[0];
- writePA(pa);
- if (len > 1) {
- uint32_t e = pa->npoints;
- m_ends.push_back(e);
- for (uint32_t i = 1; i < len; i++) {
- pa = ppa[i];
- writePA(pa);
- m_ends.push_back(e += pa->npoints);
- }
- }
+ if (len == 0)
+ return;
+ POINTARRAY *pa = ppa[0];
+ writePA(pa);
+ if (len > 1) {
+ uint32_t e = pa->npoints;
+ m_ends.push_back(e);
+ for (uint32_t i = 1; i < len; i++) {
+ pa = ppa[i];
+ writePA(pa);
+ m_ends.push_back(e += pa->npoints);
+ }
+ }
}
const Offset<Geometry> GeometryWriter::write(int depth)
{
- bool unknownGeometryType = false;
- if (depth == 0 && m_geometry_type == GeometryType::Unknown) {
- m_geometry_type = get_geometrytype(m_lwgeom);
- unknownGeometryType = true;
- }
- switch (m_geometry_type) {
- case GeometryType::Point:
- writePoint((LWPOINT *) m_lwgeom); break;
- case GeometryType::MultiPoint:
- writeMultiPoint((LWMPOINT *) m_lwgeom); break;
- case GeometryType::LineString:
- writeLineString((LWLINE *) m_lwgeom); break;
- case GeometryType::MultiLineString:
- writeMultiLineString((LWMLINE *) m_lwgeom); break;
- case GeometryType::Polygon:
- writePolygon((LWPOLY *) m_lwgeom); break;
- case GeometryType::MultiPolygon:
- return writeMultiPolygon((LWMPOLY *) m_lwgeom, depth);
- case GeometryType::GeometryCollection:
- return writeGeometryCollection((LWCOLLECTION *) m_lwgeom, depth);
- /*case GeometryType::CircularString:
- writeSimpleCurve(m_ogrGeometry->toCircularString()); break;
- case GeometryType::CompoundCurve:
- return writeCompoundCurve(m_ogrGeometry->toCompoundCurve(), depth);
- case GeometryType::CurvePolygon:
- return writeCurvePolygon(m_ogrGeometry->toCurvePolygon(), depth);
- case GeometryType::MultiCurve:
- return writeGeometryCollection(m_ogrGeometry->toMultiCurve(), depth);
- case GeometryType::MultiSurface:
- return writeGeometryCollection(m_ogrGeometry->toMultiSurface(), depth);
- case GeometryType::PolyhedralSurface:
- return writePolyhedralSurface(m_ogrGeometry->toPolyhedralSurface(), depth);
- case GeometryType::Triangle:
- writePolygon(m_ogrGeometry->toTriangle()); break;
- case GeometryType::TIN:
- writeTIN(m_ogrGeometry->toTriangulatedSurface()); break;*/
- default:
- lwerror("flatgeobuf: GeometryWriter::write: '%s' geometry type not supported",
+ bool unknownGeometryType = false;
+ if (depth == 0 && m_geometry_type == GeometryType::Unknown) {
+ m_geometry_type = get_geometrytype(m_lwgeom);
+ unknownGeometryType = true;
+ }
+ switch (m_geometry_type) {
+ case GeometryType::Point:
+ writePoint((LWPOINT *) m_lwgeom); break;
+ case GeometryType::MultiPoint:
+ writeMultiPoint((LWMPOINT *) m_lwgeom); break;
+ case GeometryType::LineString:
+ writeLineString((LWLINE *) m_lwgeom); break;
+ case GeometryType::MultiLineString:
+ writeMultiLineString((LWMLINE *) m_lwgeom); break;
+ case GeometryType::Polygon:
+ writePolygon((LWPOLY *) m_lwgeom); break;
+ case GeometryType::MultiPolygon:
+ return writeMultiPolygon((LWMPOLY *) m_lwgeom, depth);
+ case GeometryType::GeometryCollection:
+ return writeGeometryCollection((LWCOLLECTION *) m_lwgeom, depth);
+ /*case GeometryType::CircularString:
+ writeSimpleCurve(m_ogrGeometry->toCircularString()); break;
+ case GeometryType::CompoundCurve:
+ return writeCompoundCurve(m_ogrGeometry->toCompoundCurve(), depth);
+ case GeometryType::CurvePolygon:
+ return writeCurvePolygon(m_ogrGeometry->toCurvePolygon(), depth);
+ case GeometryType::MultiCurve:
+ return writeGeometryCollection(m_ogrGeometry->toMultiCurve(), depth);
+ case GeometryType::MultiSurface:
+ return writeGeometryCollection(m_ogrGeometry->toMultiSurface(), depth);
+ case GeometryType::PolyhedralSurface:
+ return writePolyhedralSurface(m_ogrGeometry->toPolyhedralSurface(), depth);
+ case GeometryType::Triangle:
+ writePolygon(m_ogrGeometry->toTriangle()); break;
+ case GeometryType::TIN:
+ writeTIN(m_ogrGeometry->toTriangulatedSurface()); break;*/
+ default:
+ lwerror("flatgeobuf: GeometryWriter::write: '%s' geometry type not supported",
lwtype_name(m_lwgeom->type));
- return 0;
- }
- const auto pEnds = m_ends.empty() ? nullptr : &m_ends;
- const auto pXy = m_xy.empty() ? nullptr : &m_xy;
- const auto pZ = m_z.empty() ? nullptr : &m_z;
- const auto pM = m_m.empty() ? nullptr : &m_m;
- const auto geometryType = depth > 0 || unknownGeometryType ? m_geometry_type : GeometryType::Unknown;
- return FlatGeobuf::CreateGeometryDirect(m_fbb, pEnds, pXy, pZ, pM, nullptr, nullptr, geometryType);
+ return 0;
+ }
+ const auto pEnds = m_ends.empty() ? nullptr : &m_ends;
+ const auto pXy = m_xy.empty() ? nullptr : &m_xy;
+ const auto pZ = m_z.empty() ? nullptr : &m_z;
+ const auto pM = m_m.empty() ? nullptr : &m_m;
+ const auto geometryType = depth > 0 || unknownGeometryType ? m_geometry_type : GeometryType::Unknown;
+ return FlatGeobuf::CreateGeometryDirect(m_fbb, pEnds, pXy, pZ, pM, nullptr, nullptr, geometryType);
}
\ No newline at end of file
diff --git a/deps/flatgeobuf/geometrywriter.h b/deps/flatgeobuf/geometrywriter.h
index 5b0401a21..38715a657 100644
--- a/deps/flatgeobuf/geometrywriter.h
+++ b/deps/flatgeobuf/geometrywriter.h
@@ -41,49 +41,49 @@ extern "C" {
namespace FlatGeobuf {
class GeometryWriter {
- private:
- flatbuffers::FlatBufferBuilder &m_fbb;
- const LWGEOM *m_lwgeom;
- FlatGeobuf::GeometryType m_geometry_type;
- const bool m_has_z;
- const bool m_has_m;
- std::vector<double> m_xy;
- std::vector<double> m_z;
- std::vector<double> m_m;
+ private:
+ flatbuffers::FlatBufferBuilder &m_fbb;
+ const LWGEOM *m_lwgeom;
+ FlatGeobuf::GeometryType m_geometry_type;
+ const bool m_has_z;
+ const bool m_has_m;
+ std::vector<double> m_xy;
+ std::vector<double> m_z;
+ std::vector<double> m_m;
- void writePoint(const LWPOINT *p);
- void writeMultiPoint(const LWMPOINT *mp);
- void writeLineString(const LWLINE *l);
- void writeMultiLineString(const LWMLINE *ml);
- void writePolygon(const LWPOLY *p);
- const flatbuffers::Offset<FlatGeobuf::Geometry> writeMultiPolygon(const LWMPOLY *mp, int depth);
- const flatbuffers::Offset<FlatGeobuf::Geometry> writeGeometryCollection(const LWCOLLECTION *gc, int depth);
+ void writePoint(const LWPOINT *p);
+ void writeMultiPoint(const LWMPOINT *mp);
+ void writeLineString(const LWLINE *l);
+ void writeMultiLineString(const LWMLINE *ml);
+ void writePolygon(const LWPOLY *p);
+ const flatbuffers::Offset<FlatGeobuf::Geometry> writeMultiPolygon(const LWMPOLY *mp, int depth);
+ const flatbuffers::Offset<FlatGeobuf::Geometry> writeGeometryCollection(const LWCOLLECTION *gc, int depth);
- void writePA(POINTARRAY *pa);
- void writePPA(POINTARRAY **ppa, uint32_t len);
- /*
- const flatbuffers::Offset<FlatGeobuf::Geometry> writeCompoundCurve(const OGRCompoundCurve *cc, int depth);
- const flatbuffers::Offset<FlatGeobuf::Geometry> writeCurvePolygon(const OGRCurvePolygon *cp, int depth);
- const flatbuffers::Offset<FlatGeobuf::Geometry> writePolyhedralSurface(const OGRPolyhedralSurface *p, int depth);
- void writeTIN(const OGRTriangulatedSurface *p);
- */
+ void writePA(POINTARRAY *pa);
+ void writePPA(POINTARRAY **ppa, uint32_t len);
+ /*
+ const flatbuffers::Offset<FlatGeobuf::Geometry> writeCompoundCurve(const OGRCompoundCurve *cc, int depth);
+ const flatbuffers::Offset<FlatGeobuf::Geometry> writeCurvePolygon(const OGRCurvePolygon *cp, int depth);
+ const flatbuffers::Offset<FlatGeobuf::Geometry> writePolyhedralSurface(const OGRPolyhedralSurface *p, int depth);
+ void writeTIN(const OGRTriangulatedSurface *p);
+ */
- public:
- GeometryWriter(
- flatbuffers::FlatBufferBuilder &fbb,
- const LWGEOM *lwgeom,
- const FlatGeobuf::GeometryType geometry_type,
- const bool has_z,
- const bool has_m) :
- m_fbb (fbb),
- m_lwgeom (lwgeom),
- m_geometry_type (geometry_type),
- m_has_z (has_z),
- m_has_m (has_m)
- { }
- std::vector<uint32_t> m_ends;
- const flatbuffers::Offset<FlatGeobuf::Geometry> write(int depth);
- static const FlatGeobuf::GeometryType get_geometrytype(const LWGEOM *lwgeom);
+ public:
+ GeometryWriter(
+ flatbuffers::FlatBufferBuilder &fbb,
+ const LWGEOM *lwgeom,
+ const FlatGeobuf::GeometryType geometry_type,
+ const bool has_z,
+ const bool has_m) :
+ m_fbb (fbb),
+ m_lwgeom (lwgeom),
+ m_geometry_type (geometry_type),
+ m_has_z (has_z),
+ m_has_m (has_m)
+ { }
+ std::vector<uint32_t> m_ends;
+ const flatbuffers::Offset<FlatGeobuf::Geometry> write(int depth);
+ static const FlatGeobuf::GeometryType get_geometrytype(const LWGEOM *lwgeom);
};
}
-----------------------------------------------------------------------
Summary of changes:
deps/flatgeobuf/flatgeobuf_c.cpp | 440 ++++++++++++++++++-------------------
deps/flatgeobuf/flatgeobuf_c.h | 16 +-
deps/flatgeobuf/geometryreader.cpp | 216 +++++++++---------
deps/flatgeobuf/geometryreader.h | 54 ++---
deps/flatgeobuf/geometrywriter.cpp | 196 ++++++++---------
deps/flatgeobuf/geometrywriter.h | 80 +++----
6 files changed, 501 insertions(+), 501 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list