cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
5611
Views
0
Helpful
3
Replies
xinzha2
Cisco Employee

Latitude and longitude coordinates in Location API

Hi,

I'm trying to visualize the visitor's location onto google map in one web application, so it's necessary to get the wifi client's location in latitude and longitude.

In location API in 10.2.2, I can only see a x,y based coordinates, is there somewhere else I can get the latitude and longitude based coordinates?

Or as an alternative solution, is there a way to get latitude and longitude by doing some calculation? If I can get the 4 cornors' lat,lng coordiantes of the building, I can translate the x,y of wifi clients location into lat,lng then. However till now I don't find a way to get cornor's coordiantes in lat,lng from MSE either.

Best Regards

Terence

1 ACCEPTED SOLUTION

Accepted Solutions
matfarre
Frequent Contributor

Hi,

MSE returns geo-coordinates when floor is has correct GPS Markers.

Matt

Test1

1. Put three or more valid GPSMarkers on a floor say (floor1) and save it in PI. While saving PI should not complain and this is an indication of these are valid GPS Markers. You can refer to below PI link.

http://www.cisco.com/c/en/us/td/docs/solutions/Enterprise/Borderless_Networks/Unified_Access/CMX/CMX_Prime.html#pgfId-1019702

2. Export this map from PI and you will get a tar.gz file.

3. Import this map to MSE 10 by using the CLI cmxconfig maps import

4. Check the log /opt/cmx/var/log/configuration/server.log and you should not see any error like ERROR com.cisco.mse.maps.ImportParser - ImportParser: Invalid GPS Marker info

Expected

Search for any client (detected or connected) on floor1 with REST API

http://<mse-ip>/api/location/v1/clients/04:db:56:af:f9:37

You should see the

geoCoordinate: {

lattitude: -81.4699689073352,

longitude: 0.00006206022536177526,

unit: "DEGREES"

}

Test2

1. Assuming you have the GPSMarker present on floor1, Add a Notification for type locationupdate, inout and movement using MSE UI ? Manage tab.

2. Check the Notification Payload sent by MSE.

Expected

You should see the geoCoordinate in the payload. Below is the example payload.

{"notifications":[{"notificationType":"inout","subscriptionName":"InOut","entity":"WIRELESS_CLIENTS","deviceId":"30:a8:89:e4:96:f7","lastSeen":"2015-05-20T00:56:56.115+0100","ssid":null,"band":null,"apMacAddress":null,"locationMapHierarchy":"System Campus>Nortech>BLE Floor","locationCoordinate":{"x":42.171116,"y":44.58178,"z":0.0,"unit":"FEET"},"geoCoordinate":{"lattitude":-121.92909062204372,"longitude":1.6066022581458773E-4,"unit":"DEGREES"},"confidenceFactor":256.0,"boundary":"INSIDE","areaType":"FLOOR","timestamp":1432079816115}]}

{"notifications":[{"notificationType":"movement","subscriptionName":"Movement","entity":"WIRELESS_CLIENTS","deviceId":"da:cc:21:3e:be:ff","lastSeen":"2015-05-20T00:54:29.638+0100","ssid":null,"band":null,"apMacAddress":null,"locationMapHierarchy":"System Campus>Nortech>BLE Floor","locationCoordinate":{"x":78.68433,"y":16.250189,"z":0.0,"unit":"FEET"},"geoCoordinate":{"lattitude":-121.92901074126753,"longitude":3.169220016955197E-4,"unit":"DEGREES"},"confidenceFactor":32.0,"moveDistanceInFt":63.234623,"timestamp":1432079669638}]}

{"notifications":[{"notificationType":"locationupdate","subscriptionName":"Test","entity":"WIRELESS_CLIENTS","deviceId":"78:33:8c:82:bd:ff","lastSeen":"2015-05-20T00:50:24.050+0100","ssid":null,"band":null,"apMacAddress":null,"locationMapHierarchy":"System Campus>Nortech>BLE Floor","locationCoordinate":{"x":36.35105,"y":77.63683,"z":0.0,"unit":"FEET"},"geoCoordinate":{"lattitude":-121.92917122084997,"longitude":1.284373308479956E-4,"unit":"DEGREES"},"confidenceFactor":136.0,"timestamp":1432079424050}]}

View solution in original post

3 REPLIES 3
xinzha2
Cisco Employee

Hi,

I'm currently looking at the https://msesandbox.cisco.com:8081/apidocs,
and I found the location api /api//location/v2/clients can give a return like below, in which I think geoCoordianate is what I need. however it is null currently and I want to know how to configure MSE so that the system can return correct lat and lng.

[

    {

        "macAddress": "00:00:2a:01:00:50",

        "mapInfo": {

            "mapHierarchyString": "CiscoLiveLatAm>MoonPalaceExpo>SecondFloor",

            "floorRefId": "723413320329068630",

            "floorDimension": {

                "length": 368,

                "width": 370.6,

                "height": 30,

                "offsetX": 0,

                "offsetY": 0,

                "unit": "FEET"

            },

            "image": {

                "imageName": "domain_0_1446506610906.jpg",

                "zoomLevel": 4,

                "width": 1093,

                "height": 1086,

                "size": 1093,

                "maxResolution": 8,

                "colorDepth": 8

            }

        },

        "mapCoordinate": {

            "x": 211.15929,

            "y": 43.78178,

            "z": 0,

            "unit": "FEET"

        },

        "currentlyTracked": true,

        "confidenceFactor": 72,

        "statistics": {

            "currentServerTime": "2016-02-23T03:26:39.802+0000",

            "firstLocatedTime": "1970-01-01T01:00:00.000+0100",

            "lastLocatedTime": "2016-02-23T03:26:38.991+0000",

            "maxDetectedRssi": {

                "apMacAddress": "00:2b:01:00:0b:00",

                "band": "IEEE_802_11_B",

                "slot": 0,

                "rssi": -31,

                "antennaIndex": 1,

                "lastHeardInSeconds": 3

            }

        },

        "historyLogReason": null,

        "geoCoordinate": null,

        "networkStatus": "ACTIVE",

        "changedOn": 1456197998991,

        "ipAddress": [

            "10.10.20.239"

        ],

        "userName": "",

        "ssId": "test",

        "sourceTimestamp": null,

        "band": "IEEE_802_11_B",

        "apMacAddress": "00:2b:01:00:0b:00",

        "dot11Status": "ASSOCIATED",

        "manufacturer": "Trw",

        "areaGlobalIdList": [

            24,

            3,

            2,

            1,

            25,

            26,

            19

        ],

        "detectingControllers": "10.10.20.90",

        "bytesSent": 132,

        "bytesReceived": 120,

        "guestUser": false

    },

… //another clients’ infomation

]

matfarre
Frequent Contributor

Hi,

MSE returns geo-coordinates when floor is has correct GPS Markers.

Matt

Test1

1. Put three or more valid GPSMarkers on a floor say (floor1) and save it in PI. While saving PI should not complain and this is an indication of these are valid GPS Markers. You can refer to below PI link.

http://www.cisco.com/c/en/us/td/docs/solutions/Enterprise/Borderless_Networks/Unified_Access/CMX/CMX_Prime.html#pgfId-1019702

2. Export this map from PI and you will get a tar.gz file.

3. Import this map to MSE 10 by using the CLI cmxconfig maps import

4. Check the log /opt/cmx/var/log/configuration/server.log and you should not see any error like ERROR com.cisco.mse.maps.ImportParser - ImportParser: Invalid GPS Marker info

Expected

Search for any client (detected or connected) on floor1 with REST API

http://<mse-ip>/api/location/v1/clients/04:db:56:af:f9:37

You should see the

geoCoordinate: {

lattitude: -81.4699689073352,

longitude: 0.00006206022536177526,

unit: "DEGREES"

}

Test2

1. Assuming you have the GPSMarker present on floor1, Add a Notification for type locationupdate, inout and movement using MSE UI ? Manage tab.

2. Check the Notification Payload sent by MSE.

Expected

You should see the geoCoordinate in the payload. Below is the example payload.

{"notifications":[{"notificationType":"inout","subscriptionName":"InOut","entity":"WIRELESS_CLIENTS","deviceId":"30:a8:89:e4:96:f7","lastSeen":"2015-05-20T00:56:56.115+0100","ssid":null,"band":null,"apMacAddress":null,"locationMapHierarchy":"System Campus>Nortech>BLE Floor","locationCoordinate":{"x":42.171116,"y":44.58178,"z":0.0,"unit":"FEET"},"geoCoordinate":{"lattitude":-121.92909062204372,"longitude":1.6066022581458773E-4,"unit":"DEGREES"},"confidenceFactor":256.0,"boundary":"INSIDE","areaType":"FLOOR","timestamp":1432079816115}]}

{"notifications":[{"notificationType":"movement","subscriptionName":"Movement","entity":"WIRELESS_CLIENTS","deviceId":"da:cc:21:3e:be:ff","lastSeen":"2015-05-20T00:54:29.638+0100","ssid":null,"band":null,"apMacAddress":null,"locationMapHierarchy":"System Campus>Nortech>BLE Floor","locationCoordinate":{"x":78.68433,"y":16.250189,"z":0.0,"unit":"FEET"},"geoCoordinate":{"lattitude":-121.92901074126753,"longitude":3.169220016955197E-4,"unit":"DEGREES"},"confidenceFactor":32.0,"moveDistanceInFt":63.234623,"timestamp":1432079669638}]}

{"notifications":[{"notificationType":"locationupdate","subscriptionName":"Test","entity":"WIRELESS_CLIENTS","deviceId":"78:33:8c:82:bd:ff","lastSeen":"2015-05-20T00:50:24.050+0100","ssid":null,"band":null,"apMacAddress":null,"locationMapHierarchy":"System Campus>Nortech>BLE Floor","locationCoordinate":{"x":36.35105,"y":77.63683,"z":0.0,"unit":"FEET"},"geoCoordinate":{"lattitude":-121.92917122084997,"longitude":1.284373308479956E-4,"unit":"DEGREES"},"confidenceFactor":136.0,"timestamp":1432079424050}]}

View solution in original post

Thanks  a lot, Matthew!

Content for Community-Ad

This widget could not be displayed.