Mapbox: Getting "Coordinate is invalid: 3.099813715520299,101.63553013450047" error for Matrix API - mapbox

I am working with matrix API https://docs.mapbox.com/api/navigation/matrix/
When I try to add the coordinates given in above link in my system and try i am getting proper result.
https://api.mapbox.com/directions-matrix/v1/mapbox/driving/-122.42,37.78;-122.45,37.91;-122.48,37.73?approaches=curb;curb;curb&access_token=<%access Token%>&sources=0&destinations=1,2
But when I am trying realtime data I am getting below error
https://api.mapbox.com/directions-matrix/v1/mapbox/driving/3.08,101.58;3.09,101.57;3.10,101.63;3.06,101.55;3.13,101.68;3.10,101.66?access_token=<%access token%>&sources=0&destinations=1,2,3,4
{
message: "Coordinate is invalid: 3.08,101.58",
code: "InvalidInput"
}
Can please help me with what the issue with coordinates

Fixed the issue.
I was using Lat,Long but map box is expecting long,lat.
So below URL worked for me
https://api.mapbox.com/directions-matrix/v1/mapbox/driving/101.63553013450047,3.099813715520299;101.65939106660886,3.1136978510187237;101.61475910726944,3.0845580973251456;101.67690052758046,3.1154119291453943;101.67346729993896,3.1075271466768917;101.66076435766543,3.083872446415484?access_token=<%AccessToken%>&sources=0&destinations=1;2;3;4

One thing also causing the Coordinate is invalid error is a redundant ; after the last pair of coordinates, so instead of e.g.
-117.17282,32.71204;-117.1470279,32.7048179; use
-117.17282,32.71204;-117.1470279,32.7048179

Related

Why am I getting and error when I add in without to my promql query?

Trying to set up a dashboard to keep an eye on my hardware. I am running into issue with the without(cpu) causing an error.
avg without(cpu) irate(node_cpu_seconds_total {instance="nodeexp:9100", job="nodeexp", mode!="idle"} [1m])
The error I get with this query is error:"1:18: parse error: unexpected identifier "irate" in aggregation"
I have also tried it this way.
avg(without(cpu) irate(node_cpu_seconds_total {instance="nodeexp:9100", job="nodeexp", mode!="idle"} [1m]))
The error I get with this query is error:"1:12: parse error: unexpected "(" in aggregation"
Not sure what I am doing wrong here. Any help would be appreciated.
I was able to figure it out.
avg without(cpu) (irate(node_cpu_seconds_total{instance="nodeexp:9100", job="nodeexp", mode!="idle"}[1m]))

Use PostGIS to retrieve the nearby points

I've tried to use PostGIS to retrieve the nearby points, however,
I've gotten an error message from the pgAdmin3.
Can you help me to debug the SQL queries (Postgresql+PostGIS) below?
Thank you for your kindness help.
I've used the 3826 geometry.
"ERROR: parse error - invalid geometry
HINT: "...79721.29349234176 2759680.13418412))" <-- parse error at position 44 within geometry" in the
SELECT * FROM pointslight
WHERE ST_DWithin(
ST_Transform(ST_GeomFromText('POINT(279721.29349234176 2759680.13418412))',3826),26986),
ST_Transform(location,26986), 50)
ORDER BY ST_Distance(ST_GeomFromText('POINT(279721.29349234176 2759680.13418412))',3826), location);
In the string defining the point, you have one opening parenthesis an two closing one. Remove one of the latter!

MATLAB : Error using histc. First Input must be a real non-sparse numeric array

I've got the error of "Error using histc. First Input must be a real non-sparse numeric array" from the following codes.
N=10^4;
d=rand(1,N)>0.5;
symbols=unique(d);
probs = histc(d,symbols)./numel(d);
P/s: I try to generate using randsrc before. It did worked.But, I'm hoping not to use randsrc because it will affect my code later on. Any ideas on this would be appreciated.
Thanks.
Here is the working code
N=10^4;
d=double(rand(1,N)>0.5);
symbols=unique(d);
probs = histc(d,symbols)./numel(d);

wordcloud package: get "Error in strwidth(...) : invalid 'cex' value"

I am using the tm and wordcloud packages in R 2.15.1.
I am trying to make a word cloud from a DTM. Here is the code:
library(wordcloud)
thedtmsparse = inspect(sparse)
trymatrix = t(thedtmsparse)
colnames(trymatrix) = c()
comparison.cloud(trymatrix, max.words=15, random.order=FALSE)
I get the following error from the last command:
Error in strwidth(words[i], cex = size[i], ...) : invalid 'cex' value
I have used the same code on another DTM where it worked fine and I got the word cloud.
Can somebody tell me a fix for the error?
Ravi
You haven't provided reproducible code (probably a big reason no one answered your question), so I can only venture to guess what the problem might be.
I faced this same error, so I'll share my experience. The problem was I had NA's instead of 0's in my term document matrix. Simply fixing that fixed that problem.

JIRA SOAP Client - return invalid field value

I have a problem using JIRA SOAP client. When I use RemoteIssue.getResolution() or RemoteIssue.getStatus() I get number values. For example let say we have an issue that has resolution = fixed. When I call client.getIssueFromJqlSearch(token, "issuetype = Bug AND resolution = fixed", 10) this will return an array of type RemoteIssue[]. Now if I call issues[i].getResolution() (where issues[] is the result from previous call getIssuesFromJqlSearch) this will return a value "5" instead of "fixed". How to solve this? Is there any way to get the value "fixed" for that issue and not a custom value "5"?
Thank you in advance.
If you call getResolutions() on the SOAP API you'll get an array of all the resolutions defined in the instance, including their Ids. You can then use this to work out which resolution the Id you've got refers to.