[Imported] Adding geo co-ordinates for objects by name using SQL


[Imported] Adding geo co-ordinates for objects by name using SQL

>>Message imported from previous forum - Category:ClearSCADA Software<<
User: florian, originally posted: 2018-10-25 15:56:41 Id:229
This is a re-posting from the obsoleted (October 2018) "Schneider Electric Telemetry & SCADA" forum.


**_Geo co-ordinates are stored in an Aggregate, which is a 'tree' of tables/classes separate from the main 'CDBObject' tree. Aggregates enable the main objects to have fewer redundant fields when there are options in the configuration. Aggregates are indexed by the id (of the main CDBObject) and the name (AggrName) [the latter because more than one aggregate can be used, but that's another story!]._**

**_Here's some SQL which updates the Geo co-ordinates of an object (assuming that the location configuration has been set to Static):_**

_update CGISLocationSrcStatic set Latitude = 51.05838, Longitude = 4.09659 where id = ( select id from cdbobject where fullname = 'mygrouppath.myobjectname')_

**_In the past, users have added metadata fields to objects for Latitude and Longitude._**

**_Contributors are invited to add the SQL which would transfer this data to the aggregate!_**