ObjectVision / 2BURP

Towards Build Urban and Rural Projections
GNU General Public License v3.0
1 stars 0 forks source link

TRI and Degree of Urbanisation: improve neighbourhood computations with combine and third_rel #44

Closed MaartenHilferink closed 5 months ago

MaartenHilferink commented 7 months ago

third_rel should wrap around the projection-boundary to support Oceania, Western hemisphere part of Russia, and the Eastern hemisphere part of Alaska.

Furthermore it should relate to the compacted domain of a continent, similar to how it now relates to a compacted kernel; in code:

unit<uint32> Neighbors := combine_uint32(CompactedLandUnit, CompactedKernelElement)
{
  attribute<domain_grid> third_rel_location := first_rel->org_rel + second_rel->org_rel;  
  attribute<domain_grid> third_rel_wrapped_location := point_xy(pointcol(third_rel_location) % pointcol(BoundRange(domain_grid)) + pointcol(LowerBound(domain_grid)), pointrow(third_rel_location));
  attribute<CompactedLandUnit> third_rel := lookup(third_rel_wrapped_location, invert(CompactedLandUnit/org_rel));
}

// example application
attribute<uint8> UrbanCount(CompactedLandUnit) := sum_uint8(IsUrban[Neighbors/third_rel], Neighbors/first_rel);
MaartenHilferink commented 7 months ago

This Neigborhood is NOT a solution for wrapping raster functions around projection boundaries, specifically: potential (convolution) and griddist.

For that one can define a new, local raster that stitches the projection boundary:

unit<wpoint> local_raster := range(0, extents_of_continent)
{
  attribute<domain_grid> org_rel := 
      point_xy(
        mod(pointcol(ID(.))+left_offset,pointcol(boundrange(domain_grid)))
    ,   pointrow(ID(.))+top_offset
    );
}

Note that: pointcol(ID(.))+left_offset must be representable in the coordinate type of domain_grid.

MaartenHilferink commented 6 months ago

See also the overview of affected raster operations and possible solutions in: https://github.com/ObjectVision/GeoDMS/issues/724

MaartenHilferink commented 5 months ago

Memory issue on TRI for NorthAmerica partially resolved: image

MaartenHilferink commented 5 months ago

image

MaartenHilferink commented 5 months ago

image