PowerBI - Show lines on a map from one point to another - powerbi

We got several OLAP Cubes in PowerBI Datasets.
One of the cubes has a dimension "dim_location" which contains columns for latitude and longitude. But each dataset has 2 pairs of values, let's call them start_latitude, start_longitude and end_latitude, end_longitude.
I got a fact table connected to that dim_location and want to show some of the measures on a map.
It works perfectly fine with both the map visual and the ArcGIS visual, if I use either the end or the start coordinates. I can show the values as circles with changing size or changing color dependent on the value of a measure. So far so good.
But what I instead want to accomplish is to show a line on the map for each dataset. Each line shall go from start point to end point, color dependent on measure value.
Is there a way to offer the coordinates in the cube dimension in some string syntax that will create a shape, like a polygon with only 2 points, which would result in a line, which can then be shown on the map?
As stated before everything works fine on the map and the ArcGIS visual with one point (lat/lon) per dataset. Tried to find help online for some polygon syntax but came up empty.

Related

Algorithm to edit a complex line in a 2D- Array needed

Short intro: I am working on a 3D laserscanning device, that creates a point cloud using pictures of an object which is illuminated by the laser.
Each picture shows essentially a line which represents the objects surface.
What I do then is store the value of brightness of each pixel in a 2D Array, which in the end results in a Matrix that puts a number on the position of the illuminated line. This I can take to further calculate the point cloud. All of this I'm doing in C++.
Now to the problem at hand:
After storing the brightness information inside the matrix, I get a complex line which is several pixels thick (thickness not uniform). I need it to be exactly 1 Pixel wide. Up until now I calculated either the mean value of the line, or used a weight function.
This only works well as long as your line mostly runs vertically or horizontally throughout the picture/matrix, because you can calculate the right value for each seperate line or column.
I have now pictures/matrices where the line has a more complex shape, so these simple solutions won't work anymore. Here are two examples:
How can I calculate the mean value or put a weight function on these lines, so i can bring them down to a thickness of 1px? I need an algorithm that does this automatically because I have sets of hundreds of pictures, where this line can be differently shaped, so it would be too timeconsuming/impossible to edit all of them seperately.
I hope I somehow talked sense rather then complicate things ;)

Is it possible to develop the line charts with multiple colors in powerbi?

I developed the few Line charts for BMP280 sensor data in powerbi. This is one of the line chart for displaying the temperature value by time and device id.
But I want same line chart with different Color like this below image, whenever temperature value suddenly changes.
Can you please tell me is it possible to develop the Line chart with multiple colors?
If you're willing to consider a vertical bar chart instead of a line chart, you would be able to create a calculation for each row that determines whether the change is significant, potentially by comparing an aggregate of recent measurements to specific thresholds.
Once you do that, you would use this column's value as a legend for your visualization. So if a row has a value of "Significant Positive Change" (or something like that), the bar or bars showing that change can be red.
Your other alternative is to use an R-based visual, of which there are surely examples of this type of visualization. I'll update this answer if I find one that looks promising.
Instead of tending 1 data series, you can split it into 2 data series e.g. one with normal temperatures and one with high temperatures. Then you can just plot these in different colours. Just make sure that the ranges are same i.e. cannot be 'Auto'.

how to remove glyphs from vtk data?

I am wondering if there is a vtk filter that replaces glyps (cone source) with a single vertex?
Here is the problem i am trying to solve. I have bunch of vector field data displayed using cone glyps. I am trying to pick a vector glyph and display vector values. I am using vtkCellPicker to pick the vector glyph. The cell picker is picking the face on the glyph instead of picking the whole glyph. So, the vector values picked are values on the face, not for the entire glyph.
If i can run the vtkData through some filter which replaces these glyps with a single vertex, i can pick the point and pick the correct vector field values.
Any help is appreciated.
You can use a vtkPolyDataConnectivityFilter (http://www.vtk.org/doc/nightly/html/classvtkPolyDataConnectivityFilter.html#details) to pull out the whole glyph starting from the one cell that is picked.
You may be better off setting GeneratePointIdsOn on your vtkGlyph3D filter which will add to the cone data an extra array with input point IDs. You can then use this to look up the original data value for display. See http://www.vtk.org/doc/nightly/html/classvtkGlyph3D.html#a1d7bfd7779ca2e229423a33a2e36e741

how to query the database to return all zip codes with a given distance (ie 5 miles) from a given zip code using geopy

Hi frens I am using geopy to calculate the latitude and longitude. Now I want to get the list of areas given distance from a zipcode.How to get that?
Well, as I can see, geopy doesn't have any built-in capability to get a list of areas around some coordinates.
But you can use a workaround. Take your geocode and calculate coordinates (latitue and longitude). Then imagine a grid on the map with a cell size equal to area of the smallest one you need to find around your location.
Use geopy to get an area name belonging to the each cell corner of your grid. Is that ok for you? It will get you some kind of approximation because a grid is not a circle and you may miss some small areas. But I think in most cases the solution will work fine.
It is much easier to locate zipcodes inside a rectangle than in a circle so I would recommend that you approximate your problem by looking for zipcodes inside a given rectangle.
Here are answers to the question of how to get list of zipcodes in given polygone: Find zipcodes inside polygon shape using google maps api
Summary
You need geometry for each zipcode. Once you have that you need to be able to query it using database that supports geoquery. One such database is Google's Fusion Table and there is already a geometry data table for zipcodes available here: https://www.google.com/fusiontables/DataSource?docid=1AxB511DayCdtmyBuYOIPHIe_WM9iG87Q3jKh6EQ#rows:id=1
Here's the sample query for Fusion Table data.
Another approach is server side code using PHP and CSV data. Here's live demo: http://daim.snm.ku.dk/demo/zip/. The page also has download for code.
If you use any of above technique please make sure to upvote answers of original authors :).

Google charts API - multiple charts on the same image

Is there a way to display multiple charts on the same image using Google Charts api?
To elaborate:
I have one data series which I want to display as bar chart.
I have another data set which has nothing to do with the first one (well they are correlated but the values are hundred times bigger).
X-axis is for dates.
I want to have second data set displayed as line chart with Y-axis on the left.
I found something similar in "Compound charts" section but as far as I understand markers are calculated based on already displayed data set - and I want to have them independent.
In other words - is it possible to make image like this:
http://chart.apis.google.com/chart?cht=bvg&chm=D,0033FF,1,0,5,1&chs=200x150&chd=t1:30,10,20|60,40,50&chxt=y
but with the line being independent and their values axis being on the right.
I'm sorry I'm not familiar with the terminology - I'm sure there is a name for what I'm trying to achieve.
Thanks!
Only 2 years behind the curve but just to let you know that I have achieved your objective of displaying 2 datasets (one a bar chart, the other a line chart) against 2 different axis scales.
The devil is in the scaling parameter &chds and explicit axis values using &chxr. Essentially, I defined the explicit scales for the x-axis, y-axis and r-axis. and then instructed the scaling parameter to scale each dataset differently.
So for an r dataset between 0 - 10 and a y dataset between 0-2 I would write;
&chds=0,2,0,10 (y then r defined in my axis parameter, i.e. &chxt=y,r)
...and...
&chxr=0,0,2|1,0,10
Let me know if you need more detail!
I've looked into something similar to this before and have used the google chart API a lot. I'm 90% sure the answer is no. Sry :(
Yep it is possible.
Here is an example of two datasets displayed on the same axes. 1 is a bar chart the other is a line graph....
This line - chd=t1:95,1,1,3,10,3,77|95,52,44,24,11,2,1 - allows for the two datasets.
slothistype