Does bbox-query return ways that are partially in the bounding box? - overpass-api

I'm trying to figure out if Overpass-API's bbox-query should be returning ways that:
Are entirely enclosed by the box (all nodes are inside the box)
Have at least one node inside the box.
At least one segment intersects with the box (even if no nodes are actually inside it).
The docs suggest that it should do #3.
http://wiki.openstreetmap.org/wiki/Overpass_API/Language_Guide#Bounding_box_clauses_.28.22bbox_query.22.2C_.22bounding_box_filter.22.29
A way is found not only if it has a node inside the bounding box but also if it just crosses somewhere the bounding box.
But, in practice I'm seeing that it's basically only #1.
Which is much less useful as that makes it difficult to make sure you've got all the ways which affect your bounding box.

I think I misunderstood. It does seem to return the ways that only intersect, ie #3, even if they have no nodes in the box. But I was confused because in my query I was also getting nodes and doing a union. It doesn't get the nodes for the way so Overpass-Turbo UI can't render the way. By recursing down, it gets the nodes as well and shows what I expect.
I was further confused because I was doing a query for relations as well, which finds many intersecting relations.
For example
<osm-script output="xml" timeout="25"><!-- fixed by auto repair -->
<!-- gather results -->
<union>
<query type="way">
<bbox-query w="-79.39941" s="43.64019" e="-79.39798" n="43.64120"/>
</query>
<query type="node">
<bbox-query w="-79.39941" s="43.64019" e="-79.39798" n="43.64120"/>
</query>
</union>
<union>
<item/>
<recurse type="down"/>
</union>
<!-- print results -->
<print mode="meta" order="quadtile"/>
</osm-script>

Related

Is it possible to scope url(#id) attributes with SVG elements in a web page?

In SVG, you can use a URL reference, such as url(#id), to point to other SVG elements on a web page. For example:
<use filter="url(#my-filter)" ...></use>
But suppose that, by accident, I end up with a naming collision like this:
<svg>
<defs>
<filter id="my-filter" x="30">
</defs>
<use filter="url(#my-filter)"></use>
</svg>
<!-- somewhere else on my page --->
<svg>
<defs>
<filter id="my-filter" x="40">
</defs>
<use filter="url(#my-filter)"></use>
</svg>
Unfortunately it seems that these url() references are not scoped. When this page displays, both of them will use the same filter -- presumably the first element to match the selector #my-filter (as opposed to the <filter> located within the <svg> context of each).
Is there some way to add scoping so that each reference points to the intended place? Or do I just have to make sure that these ids are always globally unique on my web page?
No, id values must be unique on a page.
The (id) value must be unique amongst all the IDs in the element's home subtree and must contain at least one character. The value must not contain any space characters.

ejabberd: Manipulate bookmarks with ejabberdctl

I am currently writing shell code that pushes data from LDAP into ejabberd, concerning MUC rooms. The last step I need to do is add some MUC rooms to users' bookmarks so they are auto-joined in their clients. There does not seem to be a module for that like there is in Prosody.
So I assume I need to mnipulate the users' private XML storage, in particular the storage:bookmarks part. I can get all existing bookmarks with:
ejabberdctl private_get user host storage storage:bookmarks
Then, there is ejabberdctl private_set, but I do not really understand it. From what I get, it seems that I need to replace the entire storage element at once, with old and new entries merged together.
Is there another way to add conference sub-elements to the node, or add bookmarks in some other way?
I tried to use private_set, but it seems to break on spaces in the element string. I tried escaping them in all possible ways, but to no avail.
OK, I found out for sure that adding new conferences to bookmarks requires re-uploading the entire bookmark storage set. That means the correct way is using private_get as shown in the question, then modify the XML to add a new entry and then use private_set to re-upload all of it.
As to the issue with spaces: Erlang shell (that's what ejabberdctl is) needs another level of quoting with single quotes, so some XML would become "'<storage xmlns="storage:bookmarks"><conference jid=…'" and so on in a shell argument.
You can find a shell script that does this and much more with ejabberdctl here: https://www.teckids.org/gitweb/?p=verein.git;a=blob;f=sysadmin/scripts/teckids-ejmaint
There are two standards for MUC bookmarks in XMPP. The old standard, XEP-0049, uses Private XML storage that can be modified with the private_set command. But the more recent standard is to store the bookmarks in PEP: XEP-0223
Dominik George's answer works for the old standard; for the new PEP method you can use:
sudo ./ejabberdctl send_stanza user#domain.tld user#domain.tld '
<iq type="set" id="asdf">
<pubsub xmlns="http://jabber.org/protocol/pubsub">
<publish node="storage:bookmarks">
<item id="current">
<storage xmlns="storage:bookmarks">
<conference jid="room#conference.domain.tld" autojoin="true" name="name">
<nick>nick</nick>
</conference>
</storage>
</item>
</publish>
<publish-options>
<x xmlns="jabber:x:data" type="submit">
<field var="FORM_TYPE" type="hidden">
<value>http://jabber.org/protocol/pubsub#publish-options</value>
</field>
<field var="pubsub#access_model">
<value>whitelist</value>
</field>
</x>
</publish-options>
</pubsub>
</iq>
'
This command is also accessible using the REST API: https://docs.ejabberd.im/developer/ejabberd-api/admin-api/#send-stanza

Typo3 6.2: Table Records in FCE (Flux)

I am trying to get a list of table-records in my FCE.
In documentation, i found the part "items" can use a Query.
But i can not find a way to make it work.
<flux:field.select name="myRecord" items="NOTHING WORKS HERE" label="Choose" maxItems="1" minItems="1" size="5" multiple="false" />
Does anybody know how the items can be filled with table-records ?
If you are trying to get the select box with all items maybe you can then switch to this:
<flux:field.relation size="1" minItems="0" table="tx_{YourExtensionName}_domain_model_{YourObjectName}" maxItems="1" name="package">
</flux:field.relation>
Of corse, you can use any table from the DB, like "pages"..
Hope it helps!

How to get point of interest near my point using overpass-api?

I am using Overpass API.
I have an issue to find some points of interest (cafes, hospitals, schools) near (around in 100-200 miles) my point. I have only latitude and longitude.
Overpass API gives opportunity to get POIs using your place name. But I don't have it. I have only coordinates.
How can I do that ?
Use the around statement!
<query type="node">
<around lat="..." lon="..." radius="..."/>
<has-kv k="amenity" v="cafe" />
</query>
<print />
Try this example on overpass turbo!

Umbraco - Displaying a specific image within a macro for-each child of certain node

Umbraco newbie here. I've researched a tonne but can't seem to find what I' looking for.
I have a site with a slider on the homepage, the slider is sitting in a macro which is using a for-each (of a nodes children) with a final goal to display the 'heroImage' image from that doctype. I cant post images as a newbie to this site, but heres my content structure:
HOME
PORTFOLIO
- First Item
- Another Item
ABOUT
CONTACT US
Home, Portfolio, ABOUT and CONTACT US are "Landing Pages" document types, and the children under Portfolio (First Item and Another Item) are "Portfolio Entries" document types. Below is the code on "Landing Page" calling the Slideshow macro.
Portfolio Entry has fields:
heroImage
images
body
Slideshow macro obviously being the highlight there. Easy enough. Heres my macro code where you'll see I'm trying to display the heroImage of the node in question for each 'for-each'.
<xsl:template match="/">
<!-- slider -->
<div id="slideshow">
<div id="slider" class="nivoSlider">
<xsl:for-each select="umbraco.library:GetXmlNodeById(1081)/*[#isDoc and position() < 4]">
<xsl:variable name="mediaId" select="umbraco.library:GetMedia(#id, 'false')/data [#alias = 'umbracoFile']" />
<xsl:if test="$mediaId > 0">
<xsl:variable name="mediaNode" select="umbraco.library:GetMedia($mediaId, 0)" />
<xsl:if test="count($mediaNode/data) > 0 and string($mediaNode/data[#alias='umbracoFile']) != ''">
<img src="{$mediaNode/data[#alias='umbracoFile']}" alt="[image]" />
</xsl:if>
</xsl:if>
</xsl:for-each>
</div>
</div>
<!-- data-transition="slideInLeft" -->
<script type="text/javascript">
$(window).load(function() {
$('#slider').nivoSlider();
});
</script>
</xsl:template>
I feel like im so close, and ran out of search queries as most of the solutions I found were dependant on the imageId being passed onto the macro from the other side of the macro which wouldn't work.
Hope Ive explained this enough and thanks in advance for your help!
First of all, it looks like you're hardcoding the parent node id. In the code you just provided, it seems to only be getting the children of the node with id 1081. From reading what you just posted, it would seem that on all landing pages, you want to display their individual portfolio entries.
Either way, I would stay away from hardcoding IDs. If the node id changes in any way(user deletes the node, it gets exported as a package to the live environment, etc), your code will stop working. I'd just use $currentPage instead.
Judging by your filter, I imagine you only want the first 3 items to show in the slider. The code seems correct, but you seem to be using the old schema and its associated xpath. If you're using a newer version of Umbraco, the way you reference node data in xslt would have changed. I would guess that you've found many code examples and tried merging them together, without realising they wouldn't call the same schema.
This wiki link will provide more information, and hopefully fix your problem if you're using the wrong xpath.