osgearth ThreeDTiles model data is very big - osgearth

osgearth ThreeDTiles model data is very big,Can I use LOD technology, or it uses LOD technology itself?
there is my earth file.
Model size has 3G or 4G.
<map name="Base Image" type="geocentric">
<image driver = "gdal" name = "base-world" visible = "true">
<url>./world.tif</url>
</image>
<ThreeDTiles name="Roads">
<url>./ROAD/tileset.json</url>
</ThreeDTiles>
<ThreeDTiles name="Greend">
<url>./house/tileset.json</url>
</ThreeDTiles>
<ThreeDTiles name="Building">
<url>./city/tileset.json</url>
</ThreeDTiles>
</map>

LODs would have to be designed into the 3D-Tiles model itself. OsgEarth just loads and displays it.
3D-Tiles LODs are specified using a "geometricError" value in the 3D-Tiles tileset. If the creator used geometricError for LODs, you can specify the maximum screen-space error to use (in pixels) with the "max_sse" property on your ThreeDTiles layer.
Good luck, hope this helps.

Related

Get image as byte array from web API and display it in .Net Maui application

I am calling a web API that sends back an image as a byte array. I want to show it on a form in .net Maui. I am using MVVM pattern.
I tried setting up an ImgToShow property as a byte array and set the binding of the Image control on the form to it. Doesnt work.
I tried saving the image to FileSystem.Current.AppDataDirectory and set the source of the image control to full path of the image. Doesnt work.
How does one show an image like this. Lots of examples about using FromUri as image source for image control but did not find anything much about when retrieving image as a byte array and showing it in the image control.
Kindly help.
I would start with the Maui CommunityToolkit which has wrappers around some of the most common operations - with that toolkit you can use the ByteArrayToImageSourceConverter - it should then be as simple as:
<Image Source="{Binding DotNetBotImageByteArray, Mode=OneWay, Converter={StaticResource ByteArrayToImageSourceConverter}}" />
https://github.com/MicrosoftDocs/CommunityToolkit/blob/main/docs/maui/markup/markup.md
https://github.com/MicrosoftDocs/CommunityToolkit/blob/main/docs/maui/converters/byte-array-to-image-source-converter.md
https://www.nuget.org/packages/CommunityToolkit.Maui

Is it possible to name rotations/joints in threejs and how is it possible to set them?

I am doing a bit of work with threejs. And now just wondering if it was possible to name rotations or joints.
So it seems possible to write code like:
arm.rotateZ( 180 ).name="ARM_ANGLE";
But then how does one subsequently access and set the same rotation?
I know in x3d it is possible to do this, so was thinking it would be possible to do as well in threejs. In x3d, one can define a reference as:
<Transform DEF="ArmAngle" rotation="0 0 1 3.19">
And then later define a route to reference it like:
<ROUTE fromNode='spinarm' fromField='value_changed' toNode='ArmAngle' toField='set_rotation'></ROUTE>
What you are describing sounds like animation keys or transform key frames.
You can define these in a modeller like Blender and export them or generate them programatically.
But generally, what you are describing from x3d would have to be a layer built on top of three if you really want that style of interface, but honestly, it's pretty straightforward to use the scene graph style of manipulation.. i.e. finding an object and setting its position and rotation.. OR defining an animation in a modeller and then calling that animation. The advantage of using animations is that you can then blend between them.
You CAN name Objects in three.. so for instance you could name your arm.. and then find it using scene.getObjectByName("arm"). getObjectByName is a method of all Object3Ds.

react-native: creating image from base64 string for iOS and Android (in react-native-elements list)

I'm trying to display icons in a dynamic (react-native-elements) list from a DB via REST call which delivers the icon as base64 encoded string (i.e. here done with jHipster/swagger).
It has to work for both iOS and Android.
I thought this should be a quite common use case, but it turns out somewhat challenging...
What I tried so far:
using static addImageFromBase64(base64ImageData, success, failure) see here
works for iOS only (#platform ios)
using 'data:' uri scheme like this example (as discussed here):
var base64Icon = 'data:image/png;base64,iVBORw0KGgoAAAANS ...
<Image source={{uri: base64Icon}} ... />
the PR mentioned in that discussion was closed later, but somehow it seems that 'data:' scheme still was introduced, see RCTConvert.m, although it is not documented in Image
but again it seems it was implemented only for iOS (only in the .m file)
Looking at Image for Android, it seems that rendering is delegated to the native side and this could be the reason why it was not implemented for Android (at least it does not work for me in Android).
So is there any good way to get a base64 image string into an Android react-native app?
Or is there a good practice or library to solve this (getting icons dynamically from a DB via REST API into a react-native app) in a complete different way?
In fact it works, I was just always combining some different flaws and also added React native elements to increase confusion...
Thanks to martwetzels for leading me in the right direction with the height/width hint.
If someone else has problems with images and the 'data:' scheme, these are the main obstacles I was stumbling over:
For React Native <Image>:
if you use 'data:' in an <Image>, at least you have to provide width and height in style
this is mentioned for Network images in the Guide for Images:
Unlike with static resources, you will need to manually specify the dimensions of your image.
but unfortunately it is not in the reference for Image component nor the 'data:' scheme is mentioned anywhere
So this is a working example for a React Native <Image>:
var base64Icon = 'data:image/png;base64,iVBORw0KGgoAAAANS ...
<Image style={{width: 50, height: 50}} source={{uri: base64Icon}}/>
For images in a react-native-elements <List>
only the avatar prop will take an url - the leftIcon prop is for icons from an included library like material-icons only - OR for a separate React Native element
the avatar prop can have an optional separate avatarStyle, but will by default scale the image automatically
the leftIcon prop with a nested <Image> will again need a style for the picture to appear, with at least width & height
A working example for React Native Elements <List> with leftIcon prop with an <Image> as element (style mandatory!):
<List>
{
myItems.map((item, i) => (
<ListItem
key={i}
title={item.name}
leftIcon={<Image style={{width: 35, height: 35}} source={{uri: item.base64Icon}}/>}
/>
))
}
</List>
A working example for React Native Elements <List> with avatar prop (no style, but optional avatarStyle):
<List>
{
myItems.map((item, i) => (
<ListItem
key={i}
title={item.name}
avatar={{uri: item.base64Icon}}
// optional: avatarStyle={{width: 50, height: 50}}
/>
))
}
</List>
So far this is all pretty ovious, once understood... Sorry for asking this dumb question ;-)
As a result, because all my confusion was related to documentation, I will propose some PRs for both React Native and Elements docs.
Edit: PR is now merged and doc changes regarding images with "data:" uri schema and the need to specify size are public meanwhile! Search for "data:" in:
http://facebook.github.io/react-native/docs/images.html
http://facebook.github.io/react-native/docs/image.html

Is There Aspect Ratio Cropping in CQ5, Not Just Free Crop?

The image component allows Free Ratio cropping out of the box. I'm a bit baffled at why there is no Aspect Ratio option (keeping height and width constrained to each other), which would work much better for us. Is this an existing feature that can be enabled, or a custom task in Java?
I am using CQ 5.4.
This is OOTB since 5.4 (atleast), though not well documented.. Set up your smart image widget like so:
<image-16x10
jcr:primaryType="cq:Widget"
allowFileReference="{Boolean}true"
cropParameter="./image-16x10/imageCrop"
fileReferenceParameter="fileReference"
name="./image-16x10/file"
requestSuffix=".img.png"
rotateParameter=""
title="16x10"
xtype="html5smartimage">
<cropConfig
jcr:primaryType="nt:unstructured">
<aspectRatios
jcr:primaryType="nt:unstructured">
<aspectRatio-16x10
jcr:primaryType="nt:unstructured"
text="16x10"
value="16,10"/>
</aspectRatios>
</cropConfig>
</image-16x10>
The cropConfig node structure is what youre interested in. text="16x:10" is what will appear in the Crop dropdown, value="16,10" is the actual fixed Crop size for the tool. You can add as many predefined crops you want per html5smartimage widget.
The image-16x10 and aspectRatio-16x10 names aren't required, but not a useful convention to help in maintainability of the config.If you allow multiple aspectRatios then the image-16x10 naming probably doesnt make as much sense tho its not a bad idea to provide semantic naming to your aspectRatio definition node.
If you'd like to generate images with different aspectRatios, try this...
http://experience-aem.blogspot.com/2013/09/cq-image-custom-aspect-ratios-crop.html
The crop parameters are saved in different properties and not "cropParameter" of the html5smartimage widget
That would be a custom JavaScript widget: the one you're using (smart image) does not have an aspect ratio functionality (or just I never seen one), even in 5.6.
You could extend the existing widget, and provide this functionality in your own, using Javascript though -- it's not trivial, but not rocket science either -- see source code for smart image to see how it extends smart panel, and then registers itself into the framework.

Image binding performance in pivot

I have made a calendar control based on the pivot control. Every pivot item represents one month. In this way I don't have the annoying arrows, which usually everybody use to switch between the months and I really love the native way you can browse the calendar. The calendar itself is pretty fancy and in each cell for every day, I have several images. The problem is that the performance is awful.
Initially I have bound the images visibility property with a bool property(using a converter), but I have read that the visibility binding isn't good, cause it redraws the UI elements again. Then I have decided to bind the Opacity property of the images with the same bool property from my ViewModel. The performance got better, but it is still slow. So, basically, I have a calendar with cells and 3-4 images in each cell. I am setting each image's visibility/opacity using binding, but in both ways the performance is very bad.
So, basically in each calendar cell I have 5 x this image:
<Image Source="../Images/blabla.png" IsHitTestVisible="False"
Opacity="{Binding IsBlaBla, Converter={StaticResource BoolToOpacityConverter}}" />
Have you guys have an idea how I can improve the performance? I am out of ideas. :-(
You could try setting the CacheMode to BitmapCache. See my answer to another question, it contains details of the BitmapCache option.
<Image Source="../Images/blabla.png"
IsHitTestVisible="False"
Opacity="{Binding IsBlaBla, Converter={StaticResource BoolToOpacityConverter}}"
CacheMode="BitmapCache" />
I also remember reading somewhere that the jpeg decoder is a lot faster than the png decoder. So, unless you need transparency, you could convert your images to jpeg.
Assuming your performance issue is one of the UI being slow to interact with, you might consider using David Anson's LowProfileImageLoader to alleviate the bottleneck affecting this.
Keep a low profile [LowProfileImageLoader helps the Windows Phone 7 UI thread stay responsive by loading images in the background] - Delay's Blog
There's no substitute for customer feedback! [Improving Windows Phone 7 application performance now a bit easier with LowProfileImageLoader and DeferredLoadListBox updates] - Delay's Blog
Also, there are a lot of things you can look at to tune performance. Details in the latter parts of my answer in this Question.
Design advices for quick navigation between view

Resources