OSMNX manipulation with other data - openstreetmap

I am using OSMNX to gather OSM map data to create a road network. I have real time flow data from HERE, and it is in this format:
<TRAFFICML_REALTIME xmlns="http://traffic.nokia.com/trafficml-flow-3.2" CREATED_TIMESTAMP="2021-10-26T21:42:30Z" MAP_VERSION="" UNITS="metric" VERSION="3.2">
<link type="text/css" rel="stylesheet" id="dark-mode-custom-link"/>
<link type="text/css" rel="stylesheet" id="dark-mode-general-link"/>
<style lang="en" type="text/css" id="dark-mode-custom-style"/>
<style lang="en" type="text/css" id="dark-mode-native-style"/>
<RWS TY="TMC" MAP_VERSION="202103" EBU_COUNTRY_CODE="3" EXTENDED_COUNTRY_CODE="E3" TABLE_ID="39" UNITS="metric">
<RW LI="339-01403" DE="Abdülezelpaşa Caddesi/Kadir Has Caddesi" PBT="2021-10-26T21:42:30Z" mid="e7816666-0334-48a9-b15b-673a10edf88f">
<FIS>
<FI>
<TMC PC="30026" DE="Atatürk Bulvarı/Atatürk Köprüsü" QD="+" LE="0.10589"/>
<SHP FC="3">41.02248,28.96148 41.02258,28.96139 </SHP>
<SHP FC="3">41.02258,28.96139 41.02268,28.9613 </SHP>
<SHP FC="3">41.02268,28.9613 41.02274,28.96123 41.02279,28.96119 41.02284,28.96116 </SHP>
<SHP FC="3">41.02284,28.96116 41.0229,28.96114 41.02296,28.96113 41.02303,28.96112 </SHP>
<SHP FC="3">41.02303,28.96112 41.02309,28.96111 41.02313,28.9611 41.02318,28.96108 41.02323,28.96105 41.02328,28.96101 41.02333,28.96097 </SHP>
<CF CN="0.93" FF="39.0" JF="0.0" SP="41.45" SU="41.45" TY="TR"/>
</FI>
I am trying to pair the OSM roads with this data. Is using road names the only option or is there a way I can achieve this with shape coordinates?

HERE Traffic supports 3 types of map matching mechanism (Reference).
TMC (Traffic Message Channel) - You need HERE map data content to get the location codes to mapping traffic flow to the map. But OSM doesn't bundled Traffic Location Tables which is used to mapping between HERE Traffic and map content, so it's not possible to do this way.
OLR (OpenLR Location Referencing) - You can use OLR to mapping to any map data geometries but you will need to decode OLR base64 string and mapping to the map with your algorithm because OLR only indicates start and end of road segments, you need to calculate the roads between them. Basically, it's very difficult because you need to write your own decoder first, then write your routing algorithm to perform this job.
SHP (Shape Points)- Use the shape points, however the coverage is limited and variable from time to time because it's an addition to TMC coverage.
If your requirement is to display level of congestion on the map, I would suggest to use HERE Traffic Tile instead

Related

German Novel with DkPro

I tried German Novel with DkPro. My Sample input file is an XHTML file. How can I get my PosTagger output based on the XHTML index.
Script:
PACKAGE com.github.uima.ruta.novel;
ENGINE utils.HtmlAnnotator;
ENGINE utils.HtmlConverter;
ENGINE utils.ViewWriter;
TYPESYSTEM utils.HtmlTypeSystem;
TYPESYSTEM utils.TypeSystem;
IMPORT PACKAGE de.tudarmstadt.ukp.dkpro.core.api.lexmorph.type.pos FROM desc.type.POS;
IMPORT de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Lemma FROM desc.type.LexicalUnits;
UIMAFIT org.dkpro.core.opennlp.OpenNlpSegmenter;
UIMAFIT org.dkpro.core.stanfordnlp.StanfordPosTagger;
CONFIGURE(HtmlAnnotator, "onlyContent" = false);
Document{-> EXEC(HtmlAnnotator)};
Document { -> CONFIGURE(HtmlConverter, "inputView" = "_InitialView","outputView" = "plain"),
EXEC(HtmlConverter,{TAG})};
"<\\?xml version=\"1.0\" encoding=\"UTF-8\"\\?>"->MARKUP;
uima.tcas.DocumentAnnotation{-CONTAINS(POS)} -> {
uima.tcas.DocumentAnnotation{-> SETFEATURE("language", "de")};
EXEC(OpenNlpSegmenter);
EXEC(StanfordPosTagger, {POS});
};
Sample Input
<?xml version="1.0" encoding="UTF-8"?><html xmlns="http://www.w3.org/1999/xhtml"><head xmlns="http://www.w3.org/1999/xhtml"><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><style></style><title></title></head><link xmlns="http://www.w3.org/1999/xhtml" src="./ckeditor.css" /><body xmlns="http://www.w3.org/1999/xhtml"><div class="WordSection1"><p class="Normal" data-name="Normal"><span data-bkmark="para10000"></span><span style="font-size:9pt">Der Idiot</span><span data-bkmark="para10000"></span></p>
<p class="Normal" data-name="Normal"><span data-bkmark="para10001"></span><span style="font-size:9pt">Ein Roman in vier Teilen.</span><span data-bkmark="para10001"></span></p>
</div>
<hr align="left" size="1" width="33%" /></body>
</html>
In the sample script, uima.tcas.DocumentAnnotation is sent to PosTagger Process. The MARKUP in this annotation affecting the accuracy. What I need to do to get the accuracy.
The HtmlAnnotator can be used to hide additional MARKUP so that rules are not affected by them.
The HtmlConverter is able to create a new document text without html/xml markup, but only in a new CAS view as the initial text in a CAS is static and cannot be changed.
The EXEC action is able to apply an external analysis engine on the current CAS object, and it can be configured to be applied on a different CAS view. However, the external analysis engine is applied on the complete CAS including the markup. No new CAS is created on the fly.
There are several options what you could do.
You could apply the pos tagger on the ‘plain’ view, but you cannot access these annotation with rules as the annotation will be present in a different view
You setup a multi view setting, e.g, by a two stage process. First convert the text to plain text without markup, and then apply the pos tagger on the new text
Depending on the external analysis engine, you maybe can also solve this by redefining what a token is.

Single marker fails to get rendered if it is not in or close to a cluster

In my react-leaflet map application, I am fetching the marker positions from a JSON file and want to cluster the markers which are located nearby. Using the react-leaflet-markercluster library, the clustered markers render successfully as required. However, if there is a single marker which is either not part of a cluster or close to a cluster, it does not render on the map. This is reproducible when passing the markers as an array to markers prop as well as when defining the Markers component directly in MarkerClusterGroup (as shown in example).
In the code snippet below, the first 6 markers are rendered as a cluster since they are located close. However, the last marker (position={[42.2793, -71.4162]}) is not displayed at all since it in not part of any of the clusters. What is the best way to fix this?
"leaflet": "^1.5.1",
"leaflet.markercluster": "^1.4.1",
"react-leaflet": "1.9.1",
"react-leaflet-markercluster": "^1.1.8"
Single marker outside of a MarkerClusterGroup works. However, a single marker inside the MarkerClusterGroup does not get displayed.
The required styles for Leaflet and react-leaflet-markercluster are imported in the project. I've added the following to the index.html page within the head section (as suggested here https://www.npmjs.com/package/react-leaflet-markercluster#getting-started):
<link rel="stylesheet" href="https://unpkg.com/leaflet#1.5.1/dist/leaflet.css"
integrity="sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ=="
crossorigin=""/>
<!--Make sure you put this AFTER Leaflet's CSS-->
<script src="https://unpkg.com/leaflet#1.5.1/dist/leaflet.js"
integrity="sha512-GffPMF3RvMeYyc1LWMHtK8EbPv0iNZ8/oTtHPx9/cc2ILxQ+u905qIwdpULaqDkyBKgOaB57QTMg7ztg8Jm2Og=="
crossorigin=""></script>
<link rel="stylesheet" href="https://unpkg.com/react-leaflet-markercluster/dist/styles.min.css" />
render() {
const mapCenter = [this.center.lat, this.center.lng];
return (
<LeafletMap
center={mapCenter}
zoom={this.center.zoom}
maxZoom={10}
minZoom={2.5}
maxBounds={[[-85,-180],[85,180]]}
maxBoundsViscosity={0.1}
bounceAtZoomLimits={true}
easeLinearity={0.35}
>
<TileLayer
attribution='© OpenStreetMap contributors'
url='http://{s}.tile.osm.org/{z}/{x}/{y}.png'
/>
<MarkerClusterGroup
showCoverageOnHover={false}
spiderfyDistanceMultiplier={2}
animate={true}
zoomToBoundsOnClick={true}
spiderfyOnMaxZoom={false}
maxClusterRadius={60}
>
<Marker position={[50.0647, 19.9450]} />
<Marker position={[48.9226, 24.7111]} />
<Marker position={[48.7164, 21.2611]} />
<Marker position={[51.5, -0.09]} />
<Marker position={[51.5, -0.09]} />
<Marker position={[51.5, -0.09]} />
<Marker position={[42.2793, -71.4162]} />
</MarkerClusterGroup>
</LeafletMap>
);
}
I have been using Leaflet along with Leaflet cluster for a few months now and I ran into the same issue.
If you look at your minZoom, it is 2.5 and if you have a look at the leaflet.markercluster source code particularly at the line:
https://github.com/Leaflet/Leaflet.markercluster/blob/master/src/MarkerCluster.js#L275
You will notice that either this._group._map.getMinZoom() or zoomLevel isn't rounded or floored - using Math.round or Math.floor to be exact. ( although there are some sections of the code where one or both of them are )
In the bigger picture, when this function runs recursively - it is going to get to a point where it has to match: https://github.com/Leaflet/Leaflet.markercluster/blob/master/src/MarkerCluster.js#L382
Since the value isn't floored or rounded, it is going to try to match (0.5 === 0) and this conditional will fall through. As a result, some markers are never going to be added to the map and rendered.
I got this fixed by setting the minZoom of the map to be an Integer -3. So you should go with an Integer as well - which, in your case, will be minZoom={3} or minZoom={2}
I hope this answered your question and helped.

Adding rdfa lite to Facebook Instant Articles

I am new to all forms of coding, so pls forgive me falling over my feet whilst trying to grasp this.
I am trying to setup fb instant articles & am still in the "Production Articles" mode. I have marked up on article that has already been published What is dog training
I want to include RDFa Lite syntax as well, but every time I run it through google structured data test it keeps flagging different faults up.
What "BEGINNERS ERROR" am i making her???
Thanks in advance
<!doctype html>
<html lang="en" prefix="op: http://media.facebook.com/op#">
<head>
<meta charset="utf-8">
<link rel="canonical" href="http://caninecoaching.co.uk/what-is-dog- training/">
<link rel="stylesheet" title="default" href="#">
<title>What is dog training?</title>
<meta property="http://caninecoaching.co.uk" content="Dog Training Article">
</head>
<body>
<div>
<article typeof="http://schema.org/Article">
<header>
<!-- The cover image shown inside your article -->
<figure>
<!--image-->
<span property="http://schema.org/image"><img src="http://caninecoaching.co.uk/wp-content/uploads/2016/05/What-is-Dog-Training1a.jpg" property="http://schema.org/url"/></span>
<!--image-->
<figcaption>Dog training is the process of teaching skills or behaviors to your dog.</figcaption>
</figure>
<!-- The title shown in your article -->
<h1 property="headline">What is dog training?</h1>
<!-- A kicker for your article -->
<h3 class="op-kicker" property="http://schema.org/description">
Dog training is the process of teaching skills or behaviors to your dog. This can include teaching your dog to respond to certain commands, or helping your dog learn coping skills to certain environments.
</h3>
<!-- The author of your article -->
<address>
By <span property="http://schema.org/author">Paul Daly</span> HDipCCB Head Behaviourist at <span property="http://schema.org/publisher">Canine Coaching</span>.
</address>
<!--Logo-->
<img src="http://caninecoaching.co.uk/wp-content/uploads/2016/07/cc-logo-160x-160.jpg" property="https://schema.org/logo" />
<!--Logo-->
<!-- The published and last modified time stamps -->
<time class="op-published" dateTime="2016-5-16T13:30" property="http://schema.org/datePublished">May 14th 2016, 1:30 PM</time>
<time class="op-modified" dateTime="2016-5-16T05:51" property="http://schema.org/dateModified">May 16th 2016, 05:51 AM</time>
</header>
<!-- Headline -->
<h2 property="https://schema.org/headline">What is dog training and how does it help our pets?</h2>
<!-- Headline -->
<div property="http://schema.org/mainEntityOfPage">
<p>Dog training is called classical conditioning designed by the human get a dog performing a desired behavior or skill.</p>
<p>A person who trains dogs is said to be a dog trainer. There are many methods of dog training and many objectives, from basics to more advanced including, Police, Security, Military, Rescue, Hunting, working with livestock, Dogs for the disabled and many more. As pack animals, wild dogs have natural instincts to cooperate with their fellow dogs. Many domestic dogs will either through instinct or breeding correctly interprets and responds to signals given by a human handler or owner.</p>
<p>There is much controversy about what is the most effective way to train a dog. Some dog trainers are said to be ‘positive trainers’ as they mostly use positive reinforcement to elicit, motivate, and achieve desired results. An opposing camp comes from ‘traditional’ trainers encouraging the use of punishment, often a physical stimulus used to regain the control of the dog.</p>
<p>Then there are dominance trainers, who believe all animals have an innate desire to dominate others, and that this dominating behavior needs to be overcome by owner leadership. In practice nearly all trainers use all quadrants of Classical conditioning in their training, and so use both reinforcement and punishment whether they know it or not.</p>
<p>So what do I mean by this well corrections are a form of positive punishment. Corrections can be physical (i.e. leash correction) or mental (i.e. withdrawing a reward). The dog’s personality, the behavior, and the importance of the correct behavior should all be taken into account in using corrections with your dog.</p>
<p>In a nutshell Positive Reinforcement training is in fact the use of negative corrections to eliminate a behavior and positive rewards to repeat a behavior. Pure positive training does not work because the positive reinforcement practice is a basic Classical conditioning technique that rewards dogs for responding accordingly to the trainer’s or owner commands.</p>
<p>Rewards often come through treats or verbal praise or other types of positive reinforces, such as a tug toy or ball, social interaction with other dogs, or the owner’s attention. The more rewarding a dog finds a reinforce the more work it will do to obtain the reinforce. Or does it or does it just causes additional expenses to the owner and risk the dog to potential to become overweight due to overeating. Studies show that positive reinforcement can also manipulate an animal to show both desirable and undesirable behavior depending on its experience.</p>
<p>But you add positive punishment (i.e corrections) which studies show that positive punishment has its place in dog training when combined with positive reinforcement you have a sustainable, reliable training method. Training a dog takes time and patience, however with clear and consistent communication your dog will begin to understand what you or your trainer wants from them fairly quickly.</p>
<p>This corresponds to Animal Cognition the mental capacity of non-human animals. The dog takes in the smells, the sights and sounds to remember something it has been taught. It uses your body language and your energy to gauge how serious you are about getting them to respond to you. All dogs work differently due to the breeds we have created, however they are all they same psychology.</p>
<p>We teach, we guide and we lead our dogs. Remember training is training whatever method you use or think you use.</p>
</div>
<p> </p>
<footer>
<!-- Copyright details for your article -->
<small>© <span property="http://schema.org/copyrightHolder">Canine Coaching</span></small>
</footer>
</article>
</div>
</body>
</html>
Do it like below until you get more experience.
<!DOCTYPE html>
<html lang="en" prefix="op: http://media.facebook.com/op#">
<head>
<meta charset="utf-8" />
<link rel="canonical" href="http://caninecoaching.co.uk/what-is-dog-training/" />
<link rel="stylesheet" title="default" href="#" />
<title>What is dog training?</title>
<meta property="http://caninecoaching.co.uk" content="Dog Training Article" />
</head>
<body>
<div>
<article typeof="http://schema.org/CreativeWork">
<header>
<!-- The cover image shown inside your article -->
<figure>
<span property="http://schema.org/image">
<img src="http://caninecoaching.co.uk/wp-content/uploads/2016/05/What-is-Dog-Training1a.jpg"
property="http://schema.org/url" />
</span>
<figcaption>Dog training is the process of teaching skills or behaviors to your dog.</figcaption>
</figure>
<h1>What is dog training?</h1>
<h3 class="op-kicker" property="http://schema.org/description">Dog training is the process of teaching skills or behaviors
to your dog. This can include teaching your dog to respond to certain commands, or helping your dog learn coping skills to
certain environments.</h3>
<address>By
<span property="http://schema.org/author">Paul Daly</span> HDipCCB Head Behaviourist at
<span property="http://schema.org/publisher">Canine Coaching</span>.
</address>
<!--Logo -->
<span property="http://schema.org/image">
<img src="http://caninecoaching.co.uk/wp-content/uploads/2016/07/cc-logo-160x-160.jpg"
property="http://schema.org/url" alt="canine coaching"/>
</span>
<time class="op-published" datetime="2016-05-16T13:30" property="http://schema.org/datePublished">May 14th 2016, 1:30 PM</time>
<time class="op-modified" datetime="2016-05-16T05:51" property="http://schema.org/dateModified">May 16th 2016, 05:51 AM</time></header>
<!-- Headline -->
<h2 property="http://schema.org/headline">What is dog training and how does it help our pets?</h2>
<div property="http://schema.org/mainEntityOfPage">
<p>Dog training is called classical conditioning designed by the human get a dog performing a desired behavior or
skill.</p>
<p>A person who trains dogs is said to be a dog trainer. There are many methods of dog training and many objectives, from
basics to more advanced including, Police, Security, Military, Rescue, Hunting, working with livestock, Dogs for the
disabled and many more. As pack animals, wild dogs have natural instincts to cooperate with their fellow dogs. Many
domestic dogs will either through instinct or breeding correctly interprets and responds to signals given by a human
handler or owner.</p>
<p>There is much controversy about what is the most effective way to train a dog. Some dog trainers are said to be
‘positive trainers’ as they mostly use positive reinforcement to elicit, motivate, and achieve desired results. An
opposing camp comes from ‘traditional’ trainers encouraging the use of punishment, often a physical stimulus used to
regain the control of the dog.</p>
<p>Then there are dominance trainers, who believe all animals have an innate desire to dominate others, and that this
dominating behavior needs to be overcome by owner leadership. In practice nearly all trainers use all quadrants of
Classical conditioning in their training, and so use both reinforcement and punishment whether they know it or not.</p>
<p>So what do I mean by this well corrections are a form of positive punishment. Corrections can be physical (i.e. leash
correction) or mental (i.e. withdrawing a reward). The dog’s personality, the behavior, and the importance of the
correct behavior should all be taken into account in using corrections with your dog.</p>
<p>In a nutshell
Positive Reinforcement training is
in fact the use of negative corrections to eliminate a behavior and positive rewards to repeat a behavior. Pure positive
training does not work because the
positive reinforcement practice is
a basic Classical conditioning technique that rewards dogs for responding accordingly to the trainer’s or owner
commands.</p>
<p>Rewards often come through treats or verbal praise or other types of positive reinforces, such as a tug toy or ball,
social interaction with other dogs, or the owner’s attention. The more rewarding a dog finds a reinforce the more work
it will do to obtain the reinforce. Or does it or does it just causes additional expenses to the owner and risk the dog
to potential to become overweight due to overeating. Studies show that positive reinforcement can also manipulate an
animal to show both desirable and undesirable behavior depending on its experience.</p>
<p>But you add positive punishment (i.e corrections) which studies show that positive punishment has its place in dog
training when combined with positive reinforcement you have a sustainable, reliable training method. Training a dog takes
time and patience, however with clear and consistent communication your dog will begin to understand what you or your
trainer wants from them fairly quickly.</p>
<p>This corresponds to Animal Cognition the mental capacity of non-human animals. The dog takes in the smells, the sights
and sounds to remember something it has been taught. It uses your body language and your energy to gauge how serious you
are about getting them to respond to you. All dogs work differently due to the breeds we have created, however they are
all they same psychology.</p>
<p>We teach, we guide and we lead our dogs. Remember training is training whatever method you use or think you use.</p>
</div>
<p> </p>
<footer>
<small>©
<span property="http://schema.org/copyrightHolder">Canine Coaching</span></small>
</footer>
</article>
</div>
</body>
</html>
Also, I recommend that you use the W3C HTML validator (https://validator.w3.org/#validate_by_input) as there were HTML errors in your original source.
In the future, you can learn to assign a prefix to the vocabularies-in-use and then use prefix:term as an alternative to specifying the full IRI (less typing and easier-to-read HTML).
Here is an example of declaring vocabularies:
<html
prefix="
this: http://example.com/page#
bibo: http://purl.org/ontology/bibo/
dbr: http://dbpedia.org/resources/
dc: http://purl.org/dc/terms/
foaf: http://xmlns.com/foaf/0.1/
lcsh: http://id.loc.gov/authorities/subjects/
og: http://ogp.me/ns#
ore: http://www.openarchives.org/ore/terms/
"
lang="en"
>
<body
prefix="
schema: http://schema.org/
cc: http://creativecommons.org/ns#
vivo: http://vivoweb.org/ontology/core#
swo: http://www.ebi.ac.uk/swo/
"
about="this:<your-term-here>"
typeof="cc:Work bibo:Document ore:Aggregation schema:TechArticle"
>

dhtmlx combo, autocomplete mode, js

I am having problem with autocomplete mode with dhtmlx combo.
The includes files are as follows:
// Images
<script>
window.dhx_globalImgPath="combo/dhtmlxCombo/codebase/imgs/";
</script>
// CSS
<link rel="stylesheet" type="text/css" href="combo/dhtmlxCombo/codebase/dhtmlxcombo.css">
// Required JS files
<script src="combo/dhtmlxCombo/codebase/dhtmlxcommon.js"></script>
<script src="combo/dhtmlxCombo/codebase/dhtmlxcombo.js"></script>
<script src="combo/dhtmlxCombo/codebase/ext/dhtmlxcombo_extra.js"></script>
I have no issues with the code above and works well.
The following code I have on the page I have the combo itself is as follows:
<!-- HTML Combo -->
<div id="pickup" style="width:260px;"></div>
<!-- Initialisation of combo -->
<script>
var x = new dhtmlXCombo("pickup",260,"image");
// this works
x.loadXML("list.xml");
x.enableFilteringMode(true);
</script>
My problem is i want to use autocomplete mode by using the following line of code:
x.enableFilteringMode(true, "list.xml", true, true)
When i try the above line, it doesnt give error but it doesnt filter either. However im told to use a php file but i don't know what I need to put in the list.php file itself. I can code just dont know what to put in. Can anyone shed some light, the docs arent that helpful.
enableFilteringMode enables server-side filtering. It means that when you type something in the combo header, this text is sent to the script that is defined the second parameter of the method. The script generates XML with options that correspond the mask.
Therefore, you can't use static XML in this case.
You can find a demo of the dynamic loading in the dhtmlxCombo package:
dhtmlxCombo/samples/04_filtering/01_combo_big_db.html
Also, you can use dhtmlxConnector that provides a ready solutions for the server side (PHP, ASP.NET, etc.). The dhtmlxConnector package includes a demo with dhtmlxCombo, e.g.:
dhtmlxConnector_php_v10_110725/php/samples/combo/02_sql.html

Can 2 CSS Media Query definition overlap

I am defining multiple CSS Media Queries for different vieqport or device widths...
So my question is can 2 CSS Media Query definition blocks overlap OR only 1st match gets applied. How does it work ?
Also what is the correct method to apply for multiple devices..i mean the order of defining ?
you can combine multiple media queries in a comma-separated list; if
any of the media queries in the list is true, the associated style
sheet is applied. This is the equivalent of a logical "or" operation.
https://developer.mozilla.org/en/CSS/Media_queries
So
This is the equivalent of a logical "or" operation
makes it look like only one match is applied.
http://reference.sitepoint.com/css/mediaqueries seems to confirm this as well.
If this is true (and it is untested by me), then I would create a common stylesheet to deliver all the common styles no matter what media query is matched and then have device independent stylesheets with additional styles for each targeted device.
It's weird. If you write:
<link media="screen and (max-width: 1250px)" href="/css/small.css" type="text/css" rel="stylesheet" />
<link media="screen and (max-height: 850px)" href="/css/small.css" type="text/css" rel="stylesheet" />
It acts like a XOR (having 2 stylesheets). If both conditions are met (width < 1250 AND height < 850) the stylesheet is not applied.
But if you write:
<link media="screen and (max-width: 1250px), screen and (max-height: 850px)" href="/css/small.css" type="text/css" rel="stylesheet" />
It works fine. So comma is the solution for everything.