the same station of different networks is merged into one station record
With given lon, lat (in degrees) the database can list all all stations that fall within a given radius (in metres) by the following command:
select * from stationmeta_core where ST_DistanceSphere(stationmeta_core.coordinates, ST_GeomFromText('POINT(lon lat)',4326)) < radius;
Using this command, it can be determined whether
- a new station is to be inserted into the database or
- the station's codes are to be added to an already existing station
Radius has to be defined!
First try with a radius of 100 m.
Open question:
Do we want a special REST API for inserting a new station event if it is almost at the same location as an already existing one (or a special flag (f. ex. create_new_record=true))?