<html><body><p>Hi,</p><p><br></p>
<p>I’d like to ask about one specific aspect of the MVT driver. In my
workflow, I need to track the FIDs of features inside an MVT dataset
together with their corresponding internal codes (actual parcel IDs).</p><p><br></p>
<p>My use case involves an MVT dataset of about 20 million features that
is frequently updated. For this purpose, I have implemented an
extension of the MVT driver that can open an MVT dataset in update mode
and create/delete features based on changes detected by a preceding ETL
process. Updates typically affect only a few individual features every
hour.</p><p><br></p>
<p>After the initial loading of the full dataset using <code>ogr2ogr</code>
I need a way to iterate through the dataset and build a separate table
mapping each internal FID to the parcel’s real ID. I have tried opening
and inspecting the <code>temp.db</code> file (which I do not delete):</p><p><br></p><p>GDALDataset* poTempDb =<br> (GDALDataset*) GDALOpenEx(dstTempDb.c_str(),<br> GDAL_OF_VECTOR, nullptr, nullptr, nullptr);<br><br>OGRLayer* poTempLayer = poTempDb->GetLayerByName("temp");<br>poTempLayer->ResetReading();<br><br>OGRFeature* poFeat = nullptr;<br><br>while ((poFeat = poTempLayer->GetNextFeature()) != nullptr)<br>{<br> GIntBig fid = poFeat->GetFID();<br> std::cout << "FID=" << fid << " — ";<br> int idx = poFeat->GetFieldIndex("feature");<br> int blobSize = 0;<br> const GByte* pBlob = poFeat->GetFieldAsBinary(idx, &blobSize);<br> std::cout << " Blob size=" << blobSize << std::endl;<br>}<br><br></p><p>I can successfully access the <code>feature</code>
blob, but I need to decode it in order to extract my custom parcel ID
attribute and store those values externally. This would allow me to keep
track of which parcel corresponds to which internal FID.</p><p><br>This is a one-time (potentially slow) process. Afterward, during incremental updates, I will be calling <code>CreateFeature</code> and <code>DeleteFeature</code> (and updating my external mapping table accordingly). For edits, I currently use a combination of <code>DeleteFeature</code> and <code>CreateFeature</code> (I haven’t implemented <code>SetFeature</code> yet).</p><p><br></p>
<p>My question is:<br>
<span>Is there a way to decode this blob using existing GDAL/MVT functionality, or would this require implementing a new function?</span></p><p>Thank you very much for your help.</p><p><br></p><p>Linda Karlovská</p></body></html>