4

I'm periodically getting data from an external partner that is bound to a very large fishnet (vector grid) in shapefile format. The fishnet itself sits at around 400~ megabytes, but the only data that ever changes is the tabular data in the database file.

So can you safely just swap the database file instead of redownloading the entire shapefile and shx-file every time you want to exchange data? Or are there circumstances where there might be changes to the index in the shapefile after saving the same geometry with new data?

It would of course be more practical to work with raster data for a fishnet this large anyway, but its sadly not an option in this case.

3 Answers 3

5

Shp+shx is connected with dbf only by row number. If the order of features in shp remains the same you can just change dbf to a new version. But if shape number 1 gets written as the last feature in shp and #2 becomes #1 you will have all attributes wrong. Very dangerous. But perhaps, if the data provider writes an stable ID as an attribute in a trustworthy way, you could compare the records of the old dbf with the new one. If the number of rows and the order of IDs has not changed you can update only dbf, otherwise you must update everything.

3

Your workflow could be simplified if you connect the static geographical data with the changing database by a JOIN command.

Details depends on the software you use.

You need a unique field in both data to connect them.

2

That depends entirely upon how they prepare the SHP file. If sequence of records could change, then your hack won't work. If you are certain it is the same SHP+SHX file, then you can of course skip downloading it - that is no different from any other file that is the same as what you already have.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.