How to do a timeline of layers using cesium? Display historical images - cesiumjs

like this: GeoColor
I would like to do a kind of animation using cesium. How do you think is the best way to send getMap request (maybe using webMapServiceImageryProvider) and save the result to later display each layer in time ? I was thinking to use WMSImageryProvider to create image of each layer and then, save them in viewer.imageryLayers.newMap, then loop on this new map to display layers.
To illustrate : My layer named meteo has a period dimension (january, february...) throw a year. I want to send a getMap request for dimension january, then february, then march... And after loading all of them, display one each second probably on the map to see an evolution.
For the moment, I got a panel with a button. I want my app to load this content when i click. But i do not understand for the moment how to send getMap request and save result in a map or something equal.
If any of you has an idea.

Related

Extract image from web page

How to extract the image from this https://www.google.com/maps/#45.8118462,15.9725486,3a,75y/data=!3m7!1e2!3m5!1sAF1QipOH6lgU7bug2ndyW-9-Uq0kgKqcKDtnGei2N5Qo!2e10!6shttps:%2F%2Flh5.googleusercontent.com%2Fp%2FAF1QipOH6lgU7bug2ndyW-9-Uq0kgKqcKDtnGei2N5Qo%3Dw150-h150-k-no-p!7i3024!8i4032
(If the link disappears let me describe how to reproduce the question. Find any shop on Google Maps that has the "shop title image" appearing in the shop details on the left side when you click on that shop. Click on that image to expand it across the whole viewport.)
I found the <canvas> element that I guess contains the image. I tried to do .getContext('2d') on that canvas element, but I keep getting null.
If you are getting null when doing getContext("2d") it's because an other type of context was created already, in this case, a "webgl" one.
To convert that canvas to a new image, you'd normally call canvas.toBlob() (whatever the context type).
And if you need to crop that canvas content, you'd draw it on an other canvas.
But since they did not prevent the WebGL context to throw away its drawing buffer (by passing preserveDrawingBuffer in the getContext call), you'll only get a transparent image back from it.
Anyway none of these methods will retrieve the original image, but they will create a new image entirely (probably of lesser quality, and bigger in size). To retrieve the original image, check the network tab of your dev tools, or if you need to do it programmatically, inject a script that will spoof all fetch, XHR and HTMLImageElement objects in order to log their resource URL. But that becomes dirty.

Autodesk Forge Reality Capture: Not reconstructing complete meshes

I have lately been working on Forge Reality Capture API and using simple curl commands to reconstruct some scenes from images.
The process goes through smoothly but I never obtain a complete mesh.
1.I have tried increasing the number of images about 5 times ( from 20 to 100)
2.Tried both the obj and rcm formats ( my scenetype=object)
3.I investigated the camera positions after exporting the rcm mesh to Recap photo and only about 15 positions are shown. While I used about 100 frames in several positions. Only the images from these camera positions are stiched and get an incomplete mesh.
Is this a algorithm issue in the reconstruction?
Do I have to capture more pictures? The area is relatively small, a corridor of 50m*20m.
Can I re-process the same scene by adding additional photos?
Is there a necessity for some amount of texture?
I am grateful for the answers.
Cheers!
I suggest having a look at my blog post on Reality Capture API https://forge.autodesk.com/blog/hitchhikers-guide-reality-capture-api that might help you to debug and identify the source of the problems.
The source of the problem could range from object having transparent or reflective surfaces, to your images (or some of them) not being properly uploaded.
In general, if you don't get complete mesh, the best solution is to take more pictures of the missing spots, instead of more pictures of the entire object. If there are missing spots, it means that the engine could not figure out of your images how to stitch them - more images of those areas should help.

How to make selection work for 2D multi-models in Autodesk-Forge Viewer

I have a couple of DWG drawings which I have converted into F2D files for offline viewing.
There is a base model which I load on the viewer initialization. Other drawings are loaded using viewer.loadModel as in when required.
These drawings get loaded fine. The problem is that it messes up the selection. Only one of the loaded models gets selected (and gets highlighted) on mouse down.
When I check the selection on the event received in AggregateSelectionChangedEvent, the selection has only the first model. So, I cannot even distinguish the model which has been selected.
Since some of the drawings can be loaded multiple times, (Consider a car drawing where one can load same wheel drawing and place at 4 positions) the dbId of the selected entity is same for multiple models. So, dbId can not be used as the only parameter. What I need is dbId + model.id combination to tell the selected object apart.
As per the suggestion received from elsewhere, I was setting
renderer.settings.numIdTargets = 2.
This made the selection work for multi-model pretty much as normal selection.
It worked a while, then suddenly stopped working. I am not able to figure out why.
Can anyone suggest a lasting solution to this problem?

Corona use object properties from Tiled layers

I am new to Lua scripting, and game development. So please I am just a noob in Lua.
I have searched the net for solutions to my problems, without any luck.
I use Photoshop, Corona, Dusk, json and Tiled on windows7.
I am creating a "board" like game, i.e. Setlers. I am using a world map, as the background. The background image of the game area is a world map (world.png file). I have no problem here.
I would like to create transparrent clickable objects matching the countrys borders on my gamemap with all parameters and values (I have added in Tiled) stored in the object. So When the player clicks on the country the transparrent object (on top of the map) is the one clicked and an eventlistener acts on the click.
In Tiled I can create all the objects I need, naming them + assigning parameters and other values.
If I add object.alpha value in Tiled, the alpha value is passed on to corona and working there.
How can I read these data from the json/tmx file in Corona and adding them to a lua table?
The way I am thinking to use the Tiled map and its objects, is to create one polyline trace of each country’s border (creating one object per country). Then place each “country traced object” on top of the world.png map, also naming the object with the countrys name like “object.name = TileBritannia” and also the other properties for use in game.
My problem is getting the objects info, like object.name, and an eventlistener reacting to a click on the object.
Is a polyline the right way to create a clickable area on a map, when I use a png file as a background image?
What is the best way to create a country border objects, in one layer or with all countries as individual object layers in Tiled.
Can I create one layer with sub objects and still access them in my code?
How do I get the object name and other properties, set in Tiled.
When I try to use the (local britannia = tiledMap:load("britannia.json")) the "load" is not working, getting a nil value.
I am looking for a code that will extract/get/read the object.name i.e. “objBritannia” or "TileBritannia". from the json/tmx file.
When I try to read the different parameters from the json file, I don't get the result I expect. I get the result = function: 046A73B0, was hoping for an object name of some sort.
Please provide links to or code example.
I have edited the question.
Thanks
For questions 1 and 2: I have not used Tiled, but based on Corona Tiled, you have the right strategy in mind. That page makes me think that you can just use tap event listener to detect tap. If you are having issues with the example on that web page, please update your question to be more specific. If tap event handling doesn't work (maybe you're talking about a different Tiled lib), look a Polygon fill and Point in Polygon detection, because that's basically what you need to do. Try some stuff from there. If it still doesn't work for you, then update your question with specifics otherwise it will be likely get closed (it is a little too broad as it is).
For #3, Lua is a dynamic language that supports adding properties to objects in one line. So upon the example on the Corona Tiled page, all you would have to do is
tiledMap = require("tiled")
local britannia = tiledMap:load("britannia.json")
britannia.name = "Britannnia"
local Zulu = tiledMap:load("zulu.json")
zulu.name = "zulu"
Naturally you will probably have a whole bunch so you will create a function that you call for each tile. It's not clear what map.layer["objBritannia "].nameIs("TileBritannia") is supposed to do so I can't comment.

KineticJS - How to send image to back after it has loaded (items get loaded before appear infront)

With KineticJS How do I send image to back after it has loaded (items get loaded before appear infront).
I'm loading a background Kinetic.Image and some text objects onto a layer.
Which ever order I put the calls in, the image is always at the front, when I want it at the back of the layer.
Any advice on how I should do this?
Thanks
Assuming that all the items are in the same layer, you would do something like:
image.moveToBottom();
layer.draw();
stage.draw(); //this one is not necessary really but threw it in just in case.
this would go in the onload function of your image (at the end).