How to set colour value automatically for polygons in a ESRI Shapefile? - shapefile

I have 6 values which are standing for colour values for making maps. So each number is standing for a colour. The values are always the same and the numbers are 59, 63, 70, 72, 76 and 77.
I have a lot of polygone ESRI shapefiles which are showing the administration of each country (OSM Data for example the states of India, which is the first administration level of India). To have the same style in each map for printing, I would like to use the colour values (59, 63, etc.) for every administration of each country. So each shapefile has a attribute field which is called "colour value".
Now the tricky part is: the polygons (so the states of India) should have always one of the values, but the direct neighbour state should have always another value. Otherwise the colour of the states are the same of maybe two of them, which are neighbour states, and you can't see directly the difference on the map after colouring.
I put some picture in the attachment, where you can see the correct version how it should be and the incorrect version.
Has anybody a clue how to resolve that problem automatically? Right now I have to go in each attribute field line and fill out by hand, because I have to watch which is the next neighbour to don't use the same colour value.
Thanks in advance.
Cheers,
Correct and Incorrect Version for example

Related

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

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.

How to hide/unhide one of two lines in a same plot?

I have a plot with two lines. The data ranges are very different in both lines. It I put them into a single plot without any further formatting, then one of these lines will look like a streight lines in the bottom of a plot. This happens because this line is composed of values 101, 99, 102, ..., while the second line is composed of values 10002, 12000, etc.
Is it possible to place both of these lines in a sinlge line plot? I wanted to use a dual Y axis. Or maybe there is an option of hiding/unhiding lines (with automatic rescaling).
Thanks.
Sadly, the line chart does not support dual axis at this time. Another out-of-the-box visual, the bar-line combo, can. Otherwise, there are a few work-arounds you can employ.
So, this depends a bit on your data model. When your two lines are each a series (a column) of their own, then there is no way to make a line hide or 'disappear.' However, if the lines are generated as a result of being split by a legend, then you can definitely filter one of them away, just by making the 'type' field used in the legend as a slicer.
But if you've got your data in distinct series (maybe they're from different tables or dissimilar things that don't belong in the same column), you can cheat a bit by creating a new measure and applying your scale transform there. So, if your 1st line was gadgets and your second line was widgets, and you created a new measure or column 'hundreds of widgets' = widgets / 100, then these two would graph nearby on the same chart. It's pretty much the same thing, if you think about it.
So, there's some food for thought. Good luck!

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 ;)

What are the light and dark colors on the "distributions" page of tensorboard?

In the tensorboard utility that comes with tensorflow 1.4 there is a DISTRIBUTIONS tab to the left of the HISTOGRAMS tab. When I look at a distribution, there is a light and dark color. Example:
What do the light and dark colors mean? I'm pretty sure dark is the more common values (say, the middle n-th percentiles of the distribution), but I can't find docs on it.
Ah, found documentation:
Each line on the chart represents a percentile in the distribution
over the data: for example, the bottom line shows how the minimum
value has changed over time, and the line in the middle shows how the
median has changed. Reading from top to bottom, the lines have the
following meaning: [maximum, 93%, 84%, 69%, 50%, 31%, 16%, 7%,
minimum]
These percentiles can also be viewed as standard deviation boundaries
on a normal distribution: [maximum, μ+1.5σ, μ+σ, μ+0.5σ, μ, μ-0.5σ,
μ-σ, μ-1.5σ, minimum] so that the colored regions, read from inside to
outside, have widths [σ, 2σ, 3σ] respectively.

How do I specify multiple data sets to an XY-scatter plot using the Google Chart API?

Why doesn't this Google Chart API URL render both data sets on this XY scatter plot?
http://chart.apis.google.com/chart?cht=lxy&chd=t:10,20,30,40,50,60,70,80,90,100,110,120,130,140,150,160,170,180,190,200|0.10,0.23,0.33,0.44,0.56,0.66,0.79,0.90,0.99,1.12,1.22,1.33,1.44,1.56,1.68,1.79,1.90,2.02,2.12,2.22|0.28,0.56,0.85,1.12,1.42,1.68,1.97,2.26,2.54,2.84,3.12,3.40,3.84,4.10,4.53,4.80,5.45,6.02,6.40,6.80&chco=3072F3,ff0000,00aaaa&chls=2,4,1&chs=320x240&chds=0,201,0,7&chm=s,FF0000,0,-1,5|s,0000ff,1,-1,5|s,00aa00,2,-1,5
I've read the documentation over and over again, and I can't figure it out.
First a point of clarification. You talk about a "XY scatter plot", but these are actually 2 distinct chart types in the Google Chart API. Your URL refers to cht=lxy parameter which is an XY line chart.
The first problem with your URL is your data parameter (chd). Since it is an XY line chart, data sets must be defined in pairs but I see an odd number of data sets (3).
Christian D's response is incorrect. There is no percentage requirement.
You may be better off using a wrapper API which abstracts away many of these ugly details.
I think it actually does render both data sets, but you can only se one of them because there's only one scale on the y axis. (In other words, 0.10 is too small to show.)
And, you should really be using percentages. 100 is the highest accepted value:
Where chart data string consists of positive floating point numbers from zero (0.0) to one hundred (100.0)