In order to make key decisions more conveniently according to the massive data information obtained, a spatial data mining technology based on a genetic algorithm is proposed, which is combined with the k-means algorithm. The immune principle and adaptive genetic algorithm are introduced to optimize the traditional genetic algorithm, and the K-means, GK, and IGK algorithms are compared and analyzed. The results show that, in two different datasets, the objective functions obtained by the K-means algorithm are 94.05822 and 4.10373
×
10
6
, respectively, while the objective functions obtained by the GK and IGK algorithms are 89.8619 and 3.9088
×
10
6
, respectively. The difference between the three algorithms can also be reflected in the data comparison of the number of iterations. The number of iterations required for k-means to reach the optimal solution is 8.21 and 8.4, respectively, which is the most among the three algorithms, while the number of iterations required for IGK to reach the optimal solution is 5.84 and 4.9, respectively, which is the least. Although the time required for K-means is short, by comparison, the IGK algorithm we use can get the optimal solution in relatively less time.