Load WMS service, the url is too long to get data
Load a WMS service, do not add "CQL_FILTER" parameter can request to the data, add "CQL_FILTER" parameter can not get, who can help me to analyze it? Thank you very much!
"http://192.168.8.254:8080/geoserver/workspaceTest/wms?service=WMS&version=1.1.0&request=GetMap&styles=&bbox={bbox-epsg-3857}&width=256&height=256&transparent=true&srs=EPSG:3857&format=image/png&layers=workspaceTest:accMV03&CQL_FILTER=WITHIN(GEOM, SRID = 3857; MULTIPOLYGON(((12255325.69509 3791918.95510, 12616926.21400 3762599.99411, 12646245.17499 3547594.28016, 12284644.65608 3547594.28016, 12255325.69509 3791918.95510))))"
Can post requests be used?
I have published a WMS service by geosever, and there is no problem in loading json file or rasterlayer. Now I use the cql_filter of geoserver to search the data within the search range. If the cql_filter parameter is added into the url, the style content cannot be obtained.
I want to ask:
1. How does mapbox-ios use post to request WMS or vector data?
2. Why is it not possible to get style content when CQL_FILTER parameter is added to the url, while the browser can?
My url:
http://192.168.8.254:8080/geoserver/workspaceTest/wms?service=WMS&version=1.1.0&request=GetMap&styles=&bbox={bbox-epsg-3857}&width=256&height=256&transparent=true&srs=EPSG:3857&format=image/png&layers=workspaceTest:accMV03&cql_filter=WITHIN(GEOM,SRID=3857;MULTIPOLYGON(((12255325.69509 3791918.95510, 12616926.21400 3762599.99411, 12646245.17499 3547594.28016, 12284644.65608 3547594.28016, 12255325.69509 3791918.95510))))
My log:
[ERROR] {}[Style]: Failed to load tile 2/2/1=>2 for source mapbox-streets: unsupported URL
[ERROR] {}[Style]: Failed to load tile 3/6/3=>3 for source mapbox-streets: unsupported URL
Related
I'm using Talend Open Studio for ESB - Version: 8.0.1. I have a job that loops thru data and creates a CSV for each data element, like this:
> ID DATA
> A QQQQ#$%$
> B WWWE^UTU
etc. The job creates FileA.csv, then FileB.csv etc. That all works, but the next step I need will take FileA.csv and POST that data to an API.
The URI for each file is different, so I'm using a context to create the link. The links look like this:
https://:#host/updatenodes?application_code=fileA
There is a different application code for each file. I've tested the link for these files in Postman, and they all work, here's the message:
"result": "success",
"message": "Update batch submitted with 0 items",
"threadId": []
So, the links are correct. In Talend ESB, I'm using a tFileFetch object with Post Method checked. The file image_Tal.png shows the settings
of the tFileFetch. When I use a context URL, I get this error:
> Exception in component tFileFetch_1 (Cognosos)
> java.lang.IllegalArgumentException: host parameter is null
I also tried hard-coding the full URL into the filefetch object, I get this error:
Sep 08, 2022 1:49:39 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
INFO: I/O exception (java.net.ConnectException) caught when processing request: Connection timed out: no further information
So, how do I post the data from the CSV to the API? I've tried tRest, but it wouldn't allow me to use a context variable as the URI.
Because each different file has a different ID/Password, I need to use a variable for each iteration in the loop. When I use a
context for the URI, it gives me the error "URI is not absolute". I had the same problem with RestRequest and RestClient.
Are there some settings I need to add to Talend ESB? I'm using the defaults now - I'm not sure what settings to change.
![enter image description here](https://i.stack.imgur.com/A6NA3.png)
I've tried the tRest and tRestRequest objects, but I got and error using a context for the URI. I'm trying to get the CSV data to POST to the API.
I am using a the emicklei/go-restful framework to deal with rest API.
I wish to access the route path from the request. Meaning that when I configure a dummy route like this:
ws := new(restful.WebService)
ws.Path("/resources/names")
ws.Route(ws.GET("/{name}").To(getName))
restful.DefaultContainer.Add(ws)
I wish to access the information that the route was "/resources/names/{name}"
I can access the actual URL which is call by calling:
req.Request.URL.Path
But this will return the specific URL, not the generic one.
Any suggestion?
After more research I finally found that the method req.SelectedRoutePath() will return expected value.
I'm trying to solve an issue with mt mapbox-gl-js implementation.
The data I would like to display is stored in postgis. I understand that direct postgis->mapbox-gl-js is not possible and I have to go via a geo server.
I installed geo server and get a geojson stream when I access: http://192.168.2.7:8081/geoserver/DCSIdefix/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=DCSIdefix:units&maxFeatures=500&outputFormat=application/json
I then added this as URL to the mapbox-gl-js:
var url = 'http://192.168.2.7:8081/geoserver/DCSIdefix/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=DCSIdefix:units&maxFeatures=500&outputFormat=application/json';
map.addSource('dcs', { type: 'geojson', data: URL });
after which I create the layer to display the data on the map.
Issue:
I can see the query arriving at the geoserver and the geojson is
generated but the data is not displayed on the map
if I replace the direct geoserver URL with a file on the same server instead, generated from the same
URL (quick and dirty wget batch file which overwrites the geojson file every 5 seconds) and use the file instead of the URL, it works perfectly so the geojson data is fine just the script is
somehow not able to take the data (maybe it does not wait for the full stream to arrive?).
Any help is highly appreciated!
Thanks !
I'm very new to MapBox and JavaScript/html, I'm building a Washington DC crime map with a large 10 year data set that is on my local system. The file is to large(roughly 45mb) to host on MapBox (5mb file limit). Ive tried Github pages and cant get that to work either. I need my java script to access the dataset and create pie charts using a few attributes withing the set.
I've tried alot of different ways to access the data, host it on github pages then passing the url to the add source mapbox function. I never was able to figured out the right way to do that. Ive tried to access the file using the path to it locally but I also cant figure out the right way to do that. Additionally I tried to use a sub set of the data, just ward 3 data, upload that to mapbox datasets and try accessing it that way and i get a blocked by cors policy error.
this is my most recent attempt trying to access the file I uploaded to mapbox. this returns the following error.I want to add a source and then make a cluster for each policing Shift attribute type. Not sure if this would be how to do the clusting correctly but at the moment I cant load the data correctly yet so I need to overcome that hurdle first.
ERROR Access to fetch at
'https://studio.mapbox.com/datasets/benpdoiron/cjuo3a0wha6knu9q7t9ze5gvc/'
from origin 'null' has been blocked by CORS policy: No
'Access-Control-Allow-Origin' header is present on the requested
resource. If an opaque response serves your needs, set the request's
mode to 'no-cors' to fetch the resource with CORS disabled.
CODE SNIPPET
var url="https://studio.mapbox.com/datasets/benpdoiron/cjuo3a0wha6knu9q7t9ze5gvc/";
map.on('load', function () {
map.addSource('Pie_Chart1', {
type: 'geojson',
data: url,
cluster: true,
clusterProperties: {
day: ["+", ["get", 'DAY']],
evening: ["+", ["get", 'EVENING']],
midnight: ["+", ["get", 'MIDNIGHT']]
}
The expected outcome is that the data loads and I can create functions and layers using its attributes and information. Ideally I think hosting the whole dataset, roughly 45mb, on github pages and accessing it there would be the way to go but I cant seem to figure out how to pass the file mapbox add source properly
I'm trying to use Node-RED to develop a REST based API. For example, a GET would be:
http://myurl.com/widgets/"widget-id"
where "widget-id" would be 123. I can get this to work using query strings. However, I can't seem to figure out what to put on the http input node to allow a resource id to get passed. Am I missing something obvious? Any ideas on what I need to do?
The other answer is nearly right, it just needs tweaking for Node-RED
If you set the URL in the HTTP Input node to /widget/:id
you can access the widget id in a function node linked to the HTTP Input node as follows:
var id = msg.req.params.id;
if you get all widgets:
router.get('/widgets/', function(data){});
if only one item(for example - 123):
router.get('/widgets/:id(\\d+)', function(data){});
in you're browser or if you using POSTMAN enter http url: http://youredomain.com/widgets/or http://youredomain.com/widgets/123