ThinkGeo.com    |     Blog    |     Wiki    |     Support

GridDefinition and GridFeatureSource.GenerateGrid

Can we use any projection for arguments in GridDefinition (for exemple Projection = 900913) to set RectangleShape? How to overwirite this method to use it with GenerateGrid? How to control progress of GenerateGrid method (to implement progress visualistation)?

Hi Piotr,

It’s not related with projection, if you want to make it works for 900913, you should pass into correct bounding box under 900913 and make sure each value is based on meter unit.

Regards,

Ethan

GridFeatureSource.GenerateGrid with LinealKrigingGridInterpolationModel freeze on data given in the attachment.

Hi Piotr,

I am confused about your reply, what’s the attachment you mentioned here?

Regards,

Ethan

Hi Ethan - I’ve uploaded the file - you are right I cannot see it now in this dialog. I have to reproduce it again and upload it again.

Hi Piotr,

It looks you still hadn’t uploaded that, does the file is too big?

If so I think you can upload that to our FTP or you can share from netdisk for example GoogleDrive.

Regards,

Ethan

Hi Ethan - yes, it is wired - there is no any error notification and uploading goes fine but in final view there is no file. The link to google drive: https://drive.google.com/file/d/145pwyeLaCqD0Ues8tIvIjAT-VWt4txy3/view?usp=sharing

Regards
Piotr

Hi Piotr,

I get your file, and it looks the reason is your data is too big. Your data count is: 5167300

And we used Quadtree which is from NTS inner, follow loop your data and insert the new data, it takes more and more time, that’s why it looks freeze. The test result as below should be helpful:

Count: 2000, Time: 0 Hours 0 Minutes 0 Seconds, total Seconds: 0.2024257
Count: 4000, Time: 0 Hours 0 Minutes 0 Seconds, total Seconds: 0.3582691
Count: 6000, Time: 0 Hours 0 Minutes 0 Seconds, total Seconds: 0.5745485
Count: 8000, Time: 0 Hours 0 Minutes 0 Seconds, total Seconds: 0.7893635
Count: 10000, Time: 0 Hours 0 Minutes 0 Seconds, total Seconds: 0.9621534
Count: 12000, Time: 0 Hours 0 Minutes 1 Seconds, total Seconds: 1.198954
Count: 14000, Time: 0 Hours 0 Minutes 1 Seconds, total Seconds: 1.421015
Count: 16000, Time: 0 Hours 0 Minutes 1 Seconds, total Seconds: 1.6227889
Count: 18000, Time: 0 Hours 0 Minutes 1 Seconds, total Seconds: 1.7806508
Count: 20000, Time: 0 Hours 0 Minutes 2 Seconds, total Seconds: 2.0275473
Count: 22000, Time: 0 Hours 0 Minutes 2 Seconds, total Seconds: 2.2674713
Count: 24000, Time: 0 Hours 0 Minutes 2 Seconds, total Seconds: 2.5701266
Count: 26000, Time: 0 Hours 0 Minutes 2 Seconds, total Seconds: 2.6340999
Count: 28000, Time: 0 Hours 0 Minutes 2 Seconds, total Seconds: 2.8299007
Count: 30000, Time: 0 Hours 0 Minutes 3 Seconds, total Seconds: 3.1234346
Count: 32000, Time: 0 Hours 0 Minutes 3 Seconds, total Seconds: 3.3208171
Count: 34000, Time: 0 Hours 0 Minutes 3 Seconds, total Seconds: 3.6026288
Count: 36000, Time: 0 Hours 0 Minutes 3 Seconds, total Seconds: 3.7051818
Count: 38000, Time: 0 Hours 0 Minutes 4 Seconds, total Seconds: 4.0021562
Count: 40000, Time: 0 Hours 0 Minutes 4 Seconds, total Seconds: 4.2477785
Count: 42000, Time: 0 Hours 0 Minutes 4 Seconds, total Seconds: 4.5372892
Count: 44000, Time: 0 Hours 0 Minutes 4 Seconds, total Seconds: 4.4130223
Count: 46000, Time: 0 Hours 0 Minutes 4 Seconds, total Seconds: 4.8367813
Count: 48000, Time: 0 Hours 0 Minutes 5 Seconds, total Seconds: 5.0692004
Count: 50000, Time: 0 Hours 0 Minutes 5 Seconds, total Seconds: 5.2565196
Count: 52000, Time: 0 Hours 0 Minutes 5 Seconds, total Seconds: 5.2499855
Count: 54000, Time: 0 Hours 0 Minutes 5 Seconds, total Seconds: 5.7400178
Count: 56000, Time: 0 Hours 0 Minutes 5 Seconds, total Seconds: 5.9208593
Count: 58000, Time: 0 Hours 0 Minutes 6 Seconds, total Seconds: 6.2124873
Count: 60000, Time: 0 Hours 0 Minutes 6 Seconds, total Seconds: 6.6231081
Count: 62000, Time: 0 Hours 0 Minutes 6 Seconds, total Seconds: 6.4493439
Count: 64000, Time: 0 Hours 0 Minutes 6 Seconds, total Seconds: 6.8364067
Count: 66000, Time: 0 Hours 0 Minutes 6 Seconds, total Seconds: 6.9701422
Count: 68000, Time: 0 Hours 0 Minutes 7 Seconds, total Seconds: 7.0468983
Count: 70000, Time: 0 Hours 0 Minutes 7 Seconds, total Seconds: 7.2188545
Count: 72000, Time: 0 Hours 0 Minutes 7 Seconds, total Seconds: 7.7008022
Count: 74000, Time: 0 Hours 0 Minutes 7 Seconds, total Seconds: 7.8280437
Count: 76000, Time: 0 Hours 0 Minutes 7 Seconds, total Seconds: 7.9824698
Count: 78000, Time: 0 Hours 0 Minutes 7 Seconds, total Seconds: 7.9421698
Count: 80000, Time: 0 Hours 0 Minutes 8 Seconds, total Seconds: 8.5468491
Count: 82000, Time: 0 Hours 0 Minutes 8 Seconds, total Seconds: 8.70282
Count: 84000, Time: 0 Hours 0 Minutes 8 Seconds, total Seconds: 8.8982888
Count: 86000, Time: 0 Hours 0 Minutes 9 Seconds, total Seconds: 9.2655593
Count: 88000, Time: 0 Hours 0 Minutes 9 Seconds, total Seconds: 9.3666779
Count: 90000, Time: 0 Hours 0 Minutes 9 Seconds, total Seconds: 9.5759129
Count: 92000, Time: 0 Hours 0 Minutes 9 Seconds, total Seconds: 9.8243128
Count: 94000, Time: 0 Hours 0 Minutes 9 Seconds, total Seconds: 9.6308501
Count: 96000, Time: 0 Hours 0 Minutes 10 Seconds, total Seconds: 10.1789803
Count: 98000, Time: 0 Hours 0 Minutes 10 Seconds, total Seconds: 10.5139105
Count: 100000, Time: 0 Hours 0 Minutes 10 Seconds, total Seconds: 10.6403624
Count: 102000, Time: 0 Hours 0 Minutes 10 Seconds, total Seconds: 10.6096024
Count: 104000, Time: 0 Hours 0 Minutes 11 Seconds, total Seconds: 11.016024
Count: 106000, Time: 0 Hours 0 Minutes 11 Seconds, total Seconds: 11.9071769
Count: 108000, Time: 0 Hours 0 Minutes 11 Seconds, total Seconds: 11.5505225
Count: 110000, Time: 0 Hours 0 Minutes 11 Seconds, total Seconds: 11.6981968
Count: 112000, Time: 0 Hours 0 Minutes 11 Seconds, total Seconds: 11.6756145
Count: 114000, Time: 0 Hours 0 Minutes 12 Seconds, total Seconds: 12.3248051
Count: 116000, Time: 0 Hours 0 Minutes 12 Seconds, total Seconds: 12.8423479
Count: 118000, Time: 0 Hours 0 Minutes 12 Seconds, total Seconds: 12.79488
Count: 120000, Time: 0 Hours 0 Minutes 12 Seconds, total Seconds: 12.505086
Count: 122000, Time: 0 Hours 0 Minutes 13 Seconds, total Seconds: 13.8998222
Count: 124000, Time: 0 Hours 0 Minutes 14 Seconds, total Seconds: 14.0536766
Count: 126000, Time: 0 Hours 0 Minutes 13 Seconds, total Seconds: 13.8700589

Regards,

Ethan

Thank you, Ethan - it looks like this feature should have a progress reporting function. Should the number of points be equal to or greater than the number of reference points in kirging? For example, I notice a similar “freeze” on these very short data:

GridFeatureSource.GenerateGrid
9.0.0.0
Kriging linear
Referencing Point Count:5
OpenStreetMap Context:2064384.67210706,7223971.47344186,2069099.86949518,7220804.12190064
Cell Size:39.5918942652876, no-data value:-9999
Data Points:
2066959.93358269,7222665.13535731,0
2066947.13184125,7222846.64182331,0
2066950.69406495,7222864.37324703,0
2067027.5045136,7223240.17444577,-35

Hi Piotr,

This test data is incorrect, our default value for Referencing Point is 5, and your data points only have 4 items.

So the logic go into infinite loops in the Kriging Interpolation algorithm, you should want to modify it like this:
GridFeatureSource.GenerateGrid(gd, new LinealKrigingGridInterpolationModel(points, 4), stream); // You can input 3 or smaller number here also

And you can see only 4 points, it generate 9600 points based on your bouding box and cell size, so you should want to set the setting so make sure it don’t run too long time.

Regards,

Ethan