Color limits from the HERE Map Image REST API - heatmap

We've signed up to the Pro plan and now we need to create a report using Map Image REST API to generate heatmaps using multiple colors (more than 4 colors).
I saw on the documentation that there is a limit of 4 levels and colors, I'm wondering if it's possible to use more colors in order to reach our requirements.
Do you have plans to increase the limits or beta version that doesn't have those limits?
For instance, we need to create 6 areas each one with different colors and 6 levels on the same map as shown on the following image, I should be able to use 6 different colors but only shows up 4 colors.
Map image example with 6 areas
Here is the request
GET https://image.maps.ls.hereapi.com/mia/1.6/heat
?apiKey={{API_KEY}}
# Area 1 - Yellow
&a0=49.27,-123.48
&rad0=1900
&l0=0
# Area 2 - Red
&a1=49.25,-123.38
&rad1=1500
&l1=1
# Area 3 - Blue
&a2=49.18,-123.342144
&rad2=1500
&l2=2
# Area 4 - Green
&a3=49.28,-123.35
&rad3=1000
&l3=3
# Area 5 - Orange
&a4=49.21,-123.55
&rad4=1800
&l4=4
# Area 6 - White
&a5=49.30,-123.60
&rad5=1000
&l5=5
#
&z=11
&w=900
&h=900
&plt=FCFF00,EB2501,001EFF,1FE80C,FF8C0D,FFFFFF
Thanks!

I can't speak to our plans for this API, I can, however, raise a ticket internally asking that this be considered. My guess is that it's for performance as well as "length of URL" concerns, but at minimum I can ask.

Related

adding a legend outside of barchart

I created a side by side barchart using this this code
IT=c(0.588, 0.765)
DE=c(0.214, 0.63)
FR=c(0.37, 0.73)
PL=c(0.692,0.793)
GB=c(0.381, 0.757)
NL=c(0.227, 0.62)
GR=c(0.692, 0.902)
HU=c(0.706, 0.698)
SE=c(0.143, 0.493)
# combine two vectors using cbind
# function
CountryChart=cbind(IT,DE,FR,PL,UK,NL,GR,HU,SE)
barplot(CountryChart,beside=T, ylim =c(0,1), )
and I got this graph
I need to add a legend to the graph but I am unable to do it.
What I would like to do is add the following title to the entire graph 'Percentage of ERWP supporters and opposers per country, who rate the refugee issue as a major threat'
I also want add a description for the bars, with a title 'Opinion on ERWP' where I specify that the dark grey bars are 'unfavorable' and light grey bars are 'favorable'
For example:
legend("topright" , legend=c("Unfavorable","Favorable"), title="Opinion on ERWP")

tesseract didn't get the little labels

I've installed tesseract on my linux environment.
It works when I execute something like
# tesseract myPic.jpg /output
But my pic has some little labels and tesseract didn't see them.
Is an option is available to set a pitch or something like that ?
Example of text labels:
With this pic, tesseract doesn't recognize any value...
But with this pic:
I have the following output:
J8
J7A-J7B P7 \
2
40 50 0 180 190
200
P1 P2 7
110 110
\ l
For example, in this case, the 90 (on top left) is not seen by tesseract...
I think it's just an option to define or somethink like that, no ?
Thx
In order to get accurate results from Tesseract (as well as any OCR engine) you will need to follow some guidelines as can be seen in my answer on this post:
Junk results when using Tesseract OCR and tess-two
Here is the gist of it:
Use a high resolution image (if needed) 300 DPI is minimum
Make sure there is no shadows or bends in the image
If there is any skew, you will need to fix the image in code prior to ocr
Use a dictionary to help get good results
Adjust the text size (12 pt font is ideal)
Binarize the image and use image processing algorithms to remove noise
It is also recommended to spend some time training the OCR engine to receive better results as seen in this link: Training Tesseract
I took the 2 images that you shared and ran some image processing on them using the LEADTOOLS SDK (disclaimer: I am an employee of this company) and was able to get better results than you were getting with the processed images, but since the original images aren't the greatest - it still was not 100%. Here is the code I used to try and fix the images:
//initialize the codecs class
using (RasterCodecs codecs = new RasterCodecs())
{
//load the file
using (RasterImage img = codecs.Load(filename))
{
//Run the image processing sequence starting by resizing the image
double newWidth = (img.Width / (double)img.XResolution) * 300;
double newHeight = (img.Height / (double)img.YResolution) * 300;
SizeCommand sizeCommand = new SizeCommand((int)newWidth, (int)newHeight, RasterSizeFlags.Resample);
sizeCommand.Run(img);
//binarize the image
AutoBinarizeCommand autoBinarize = new AutoBinarizeCommand();
autoBinarize.Run(img);
//change it to 1BPP
ColorResolutionCommand colorResolution = new ColorResolutionCommand();
colorResolution.BitsPerPixel = 1;
colorResolution.Run(img);
//save the image as PNG
codecs.Save(img, outputFile, RasterImageFormat.Png, 0);
}
}
Here are the output images from this process:

Code for creating dependent options in Volusion

I working on setting up a new site and Volusion doesn't appear to have any tools available to create dependent options. I will have products on the store that will have multiple option combinations (see example below)
Option 1: Color (Red, Blue,Green)
Based on the selection of option 1, I need the correct option 2 to appear.
Option 2: Personalization
If red is selected---Line 1: 5 characters Line 2: 10 characters
If blue is selected---Line 1: 5 characters
If green is selected-- Line 1: 8 characters Line 2: 20 characters
While I would LOVE for the personaization options to appear and link to the option 1, I would also be okay to just use the "Option Side Note" in Volution which can automatically populate a note of text. Does anyone know an HTML code I can use for the Color option so that the text notes would automatically change to let the customer know the lines and characters to include?
It sounds like you are looking for Volusion SmartMatch functionality, at least in part.
http://support.volusion.com/article/smart-match

5 star rating system in actionscript 3

i need to build a 5 star rating for a image gallery. when someone rates a image from the gallery i need to retrieve the rating (say like .5 or 2.5 or 3 or 4.5 or 5)
How can we create something like a 5 star rating system in AS 3.0?
Edited:
not the solutions to send the rating vlues to database... I am looking for the logic to set the rating (stars changing the color indicating the rating has been updated) and get the rating values applied...
Now that the question has completely changed, lets look at displaying some stars:
You can use the Polygon tool to create stars. Select this tool and then in properties, select Options and then Star.
Draw 5 stars on a layer.
Convert these to a MovieClip.
Place them on their own layer. Copy them and then place them onto another layer.
Draw a rectangle that will be the color you want to fill the stars with large enough to cover all of the stars. Put this on another layer and then mask that with one of the star layers. Convert the rectangle to a MovieClip so you can tween it.
Create a tween of the rectangle moving from the left to the right so that it slowly covers the stars.
You should have something like this:
Use gotoAndStop() to stop on a desired frame. In my example, 50 is a full 5-star rating. 25 would be a 2.5 star rating and fill 2 and a half stars. Etc.
Old Answer
I'm keeping this here purely for the sake of people searching for things like "rating system in AS3" which will most likely require the below info.
You'll need to store the ratings in a database. The concept I use (and probably that everyone else uses) is that you store records containing a voter, the rating they assigned and what they voted on eg:
Marty | 3 | hat.jpg
John | 5 | hat.jpg
Simon | 1 | tasty-cereal.jpg
You then request all of the records that relate to a given image, combine all of the ratings found and then divide the total you get by the amount of ratings given. This will yield the average which will represent a rating out of 5.
As an example, the rating for hat.jpg could be found like this in PHP:
<?php
$score = 0;
$query = mysql_query("SELECT ratings.score FROM ratings WHERE image='$image_from_flash'");
while($row = mysql_fetch_assoc($query))
{
$score += $row["score"];
}
$average = $score / mysql_num_rows($query);
echo $average; // This will be sent back to AS3.
?>
To send and receive the ratings, you will need to use URLLoader to communicate with server-side technology, like PHP. This will talk to the database, work out the average as I mentioned above and then send back to AS3 the average rating for you to use.
If you need information about how to work with PHP + AS3 and send information between the two, that's an entirely different question that will require a very detailed answer. You're better off Googling for information about this.
Let me get you started:
Send and load variables with AS3 and PHP
You may want to think about it as a volume slider. for example:
you have a a movie clip of 5 stars that is 100px in width. you make a mask that is 100px wide to cover up the stars. Set up an event listener for MouseEvent.CLICK on the stars movieclip and make the width of the mask whatever the mouseX is relative to the the total width of the clip. something like:
var relativeMouseX:int = mouseX - stars.x; // you'll get a number between 0-100px
so if the value is say 67px then you can do this operation:
67/100 = .67 * 5 = 3.35;
3.35 stars would be the rating.
starsMask.width = relativeMouseX; //makes the mask's width reflect how many stars is showing.

Drawing a bar chart, but with some restriction

I want to draw a chart in linux like this:
1################# 64.85
2################### 72.84
3####################### 91.19
4####################### 91.61
5########################### 108.66
6############################ 110.69
7###################################### 149.85
8####################################### 156.60
9########################################### 169.81
I want to do that in python, of course you noticed that I don't want code like:
for i in data:
print "#"*i
because data may contain big numbers, so it is not nice to print "#" milion times.
So what is the mathematical equation that I must use to do this, I think this is a kind of mathematical problem
Thanks a lot
You have to work with percentages I think sum up all you values and then you do bar value / total of bar values
So if I have the following values 1 2 3 6 the total will be 12 so then
i will do 1 / 12 the percentage will be 8 so you print '#' 8 times and so on.
then the max # you can print is hundred.
I don't know if this is what you want, but hope this will help.