How to subset a linnet object - spatstat

I would like to subset a linnet object to get a list of linnet objects. In the helpfile I see that this is possible with a owin object. But I get errors as the syntax is not clear to me and also not clear is the use of snip argument in the call to subset.
I want to split linnet based on a user-attribute coming from marks or split a linnet object based on a windows (each window being a polygon from an shapefile)
Could someone please suggest how to subset a linnet based on a factor/window to get a list of linnet objects:
Using a user attribute/factor/mark on line segments.
Same values of marks are on contagious line segments, so this is ideally similar to using a window.
Using polygons as owin.
Thank you

If L is a network and P is a polygonal window then L[P] computes the intersection of L and P.
The help file for [.linnet includes examples which demonstrate the syntax of this command and which show the effect of the argument snip.

Related

How to structure a COLLADA file to reuse geometry multiple times but set individual metadata for each object in the scene?

Inside <library_visual_scene> I set references to geometry nodes in the <library_geometries> section. Using <extra> and <technique> I can attach metadata (= alphanumeric data) to the geometry.
From the visual scene section I can reference the same geometry multiple times to and place it at different positions using <matrix>. But in this case, all instances have the same metadata.
I'm looking for a concept to store individual metadata for each object in the visual scene while referencing one geometry node.
A COLLADA sample file would be helpful - Thanks!
The concept above is identical to the behaviour in AutoCAD for blocks with attributes (=metadata). There I can define geometrie and attributes in a block definition. When I place the block reference I can set individual attribute values for each block reference.

How to pass gnuradio-like tags in REDHAWK

I'm trying to replicate gnuradio-like tags in REDHAWK, SRI looks a bit promising but I'm not sure that I can achieve my goal with that tool.
I'll give a basic example, let's say that I have a component that detects that a certain signal starts at a position. This component doesn't do anything else but this. I'd like to pass this information onto the second component so that It can start working from that position forward.
Is there any way to mark the specific position in the bulkio stream and pass it to the next component?
gnuradio has tags, that can pass any userdata between computational components, and it's precise to the bit.
Have you tried using keywords? They are part of the SRI data structures and are a list of key value pairs. The key is a user defined string and the value is any standard type (double, string, int, etc). Here is how front end devices use them to pass along filter bandwidth and frequency information: http://redhawksdr.github.io/Documentation/mainap6.html#x25-542000F.5.2

Add custom attributes to PlotCurveItem in pyqtgraph

I have several curves on one PlotItem. I add them through method plot(). So each of them is a PlotCurveItem instance.
I would like to add additional information to certain curve in order to click on any it and get attribute. Moreover, I want to get attribure that corresponds to x,y of this curve.
Any ideas?

How do you access THREE.Geometry?

How can you create a multi faceted object like say in a shape of the mountain? Without resorting to something like THREE.PlaneGeometry? Can you use THREE.Geometry instead?
Three.PlaneGeoemtry is only a preset for the user that already generates the vertex positions and UV-coordinates for you. For creating a mountain, you should stick to Three.PlaneGeometry and move the vertices up and down, depending on some height values of any kind you wish (function, or height map texture or whatever). You could also create your own Three.Geometry object but in the end, I think, you will end up with something very close to PlaneGeometry.

Raphael js get element's rotation

Is there a way to get an elements rotation value using the raphaeljs library? I'm sure there is but I can't find it anywhere in the documentation. I imagine its goes something like this .attr('rotation') but this doesn't work.
Use the Element.transform() function to get the current transformation data as well as to set it.
You probably already know that element.transform(tstring) sets the transform data, including rotation.
To get that data back from Raphael, simply call element.transform() without any parameters:
tstring = element.transform();`
Hope that helps.
Here are four ways I've found to get a Raphaël element's rotation value:
console.log(el.attr('transform')[0][1]);
console.log(el.transform()[0][1]);
console.log(el.matrix.split().rotate);
console.log(el.matrix.toTransformString().split('r')[1]);
Specific outputs differ based on previously applied transformations.
If no transformation has yet been applied, the first two will throw 'cannot read property of undefined' errors, the second will log -0, and the fourth will log undefined.
If a previous transformation between -90° and 269.999° (inclusive) has been applied, all four log that transformation (though the third will be off by a few decimals, and the fourth will be followed by 0,0).
If a previous transformation outside the above range has been applied, the first two log that complete transformation, and the second two log a value relative to and less than 360° (and again, the third will be off by a few decimals, and the fourth will be followed by 0,0).
If multiple transformations have been applied to the element, these get pushed onto the array that's accessed by the first two, and thus the first bracket-notation index would need to be adjusted accordingly (or it will only log the first rotation applied, not the sum of all rotations).
DOCS:
http://raphaeljs.com/reference.html#Element.attr
http://raphaeljs.com/reference.html#Element.transform
http://raphaeljs.com/reference.html#Matrix.split

Resources