I've sensor that sends X Y coordinates for an Indoor Map I want to Convert X-Y to correspondent geolocation and Plot Coordinates into a Custom Map

Hello Geeks ,

I've sensors that send X Y coordinates for an Indoor Map , I have successfully managed to
Build a custom map on kibana using GeoServer , But I'm stuck with the following for more than a month now.

1- Convert X Y Coordinates for this indoor map into correspondent lat and long.

2- Plot the data on the map with the Right Scale and distribution of data.

I don't know if this task is even possible in Kibana , I'd really appreciate you suggestions.

Thanks
Alex

@Alex_S

1- Convert X Y Coordinates for this indoor map into correspondent lat and long.

You'll have to manually convert the x y coordinates on the indoor map into the corresponding latitude and longitude.

2- Plot the data on the map with the Right Scale and distribution of data.

Maps, and all visualizations in Kibana, operate on aggregates, so if you're looking to plot individual data point, this isn't currently possible. This enhancement request is targeted at allowing this if you wouldn't mind reviewing it, commenting or :thumbsup:ing it.

Once you have your data stored in geopoints with lat/long, you should be able to visualize the aggregate information on the Tilemap and plug in your own WMS server to provide custom layers.

1 Like

Are you looking to do something similar to what is described in this blog post?

2 Likes

Hi @Christian
Thanks for you reply

Yes indeed , But do you have any Idea on how I can transform my X -Y Coordinates or pixels
into Corespondent Lat and long for my Indoor map ?

Hi @Brandon_Kobel

thanks for your reply

But what do you mean by manually ? , is there is a formula that converts X-Y pixels or coordinates
into corespondent lat and long ? , What do you suggest ?

Do that conversion when you index the data, e.g. in Logstash.

@Christian_Dahlqvist
How to make the conversion in Logstash?
Thanks.

I suspect you may need to use a ruby filter for this type of conversion. Exactly how the calculation/transformation will need to look like I have no idea about as I do not know your data.

The data is about X Y Coordinates for an indoor map

If you look at the blog post I linked to, coordinates on the map are mapped to lat/long coordinates, and this mapping depends on how you map the image in your custom WMS tile server. There is also a link to an older, but potentially simpler, blog post on a similar topic that may also be useful.

I did this blog post before but still stuck at the point of conversion the X Y coordinates into lat /long to plot the data on the custom map which i use

What is the X/Y range of the map you want to plot on? What is the lat/long range of the map on the WMS server?

The map range is
Width= 2360 pixel
Height= 718 pixel

lat/long range is
Min X = -105
Min Y = -45.025760784097045
Max X = 104.96748940076955
Max Y = 45

What does the coordinates in your events look like? Are they expressed as pixels indicating where they belong on the map?

Yes, they are

Lets assume the event contains fields X (in range 0 to 2360) and Y (in range 0 to 718).

Assume the following variables are to be used in the calculation/conversion:

x_range = 2360
y_range = 718
lat_min = -45.025760784097045
lat_max = 45
long_min = -105
long_max = 104.96748940076955
lat_range = lat_max - lat_min
long_range = long_max - long_min

Based on this you need to project the coordinate onto the lat/long space. I think something like this should work, but I have not tested it:

lat = lat_min + (Y * lat_range / y_range)
long =  long_min + (X * long_range / x_range)

As I am not a Ruby developer I will leave translating this into a Ruby filter to you.

1 Like

Thanks for your effort. I really appreciate it.

Sounds like you need to apply anaffine transformation. This will shift, rotation and scale of your points. To do this you will need to work out the location of at least one of your xy points as lat long. If you know 2 points you can work out the scale factor.

You then need to work out the orientation of your points relative to the geographic coordinate system.

If you search for affine transformation you should find code to do this.

@Graham_Humphries Yes, You are right, it already shifted the location of points on the map. I think because the origin of the map in pixel is top left not the same as the custom map in Geoserver which is the center of the image.
I will look for affine transformation to see what can i do.
Thanks for your interest.

Your lat long intervals are quite large, so the projection is likely to suffer from distortion. If you mapped it against a much smaller lat/long interval, you may be able to reduce the distortion.