Cant share data easy, it needs few layers of conversions and libraries to be used, and it also has NDA along.
I have tried to find real source in code, it came to section below. If i use Envelope it will check 35k cityCenters18
in few seconds and no much memory change after initial loading, but when i remove .Envelope from candidates[i].Envelope.Contains(cc) process starts to eat memory and eats 300MB before it is done, but it will finish all.
If i then also change candidates to
var candidates = buildups.Select(x => PreparedGeometryFactory.Prepare((Polygon)x.Pts)).ToArray();
it will eat 800MB and die due to .NET 32 bit process limitations. If you have any advice what to try next please help. I will try to reconstruct this with some OSM data. This is very similar to checking if POIs are inside city poligons for some large country.
var candidates = buildups.Select(x => (Polygon)x.Pts).ToArray();
int nfnd = 0;
int fnd = 0;
foreach (var cc in cityCenters18)
{
bool found = false;
for (int i = 0; i < candidates.Length; ++i)
if (candidates[i].Envelope.Contains(cc))
{
found = true;
fnd++;
break;
}
if (!found)
++nfnd;
Console.Write(nfnd.ToString() + "\t" + fnd.ToString() + "\r");
}