This invention relates to a method for generating grid codes for planar objects, belonging to the field of traffic control technology. It solves the problems of low efficiency,
high complexity, and massive computational load in existing planar object
grid code generation algorithms. This invention first obtains the lowest-level
grid code containing the planar
object based on
grid code hierarchy rules. It then calculates the set of
boundary line grid codes that satisfy
distance constraints with the planar object's
boundary line. Using this set of
boundary line grid codes as a reference, the invention decomposes the lowest-level grid code containing the planar
object level by level, comparing the inclusion and positional relationships between the decomposed grids and the planar object's boundary line grid code set. This quickly locates grids within the planar object and performs deduplication and aggregation
processing to further reduce computational load. Compared to existing technologies, this method achieves rapid and efficient generation of planar object grid codes with minimal computational load and very
simple algorithm complexity.