Assign id numbers to spatial map
Split into separate files