Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of https://github.com/milovanderlinden/openstre…

…etblock into prmerge
  • Loading branch information...
commit 8d9c25a8cafca29cff8d4c8eac9d41977db3379d 2 parents 67ed379 + a92d5c8
@fruminator authored
Showing with 8 additions and 2 deletions.
  1. +8 −2 osb.inc.php
View
10 osb.inc.php
@@ -24,8 +24,14 @@ function OpenStreetBlock($lat, $lon, $db, $max_nodes_expand = OSB_MAX_NODES_EXPA
$res = array();
# this is not really SQL safe is it?
- $wkt_point = sprintf("Point(%s %s)", $lon, $lat);
-
+try {
+ $flat = floatval($lat);
+ $flon = floatval($lon);
+ $wkt_point = sprintf("Point(%f %f)", $flon, $flat);
+} catch (Exception $e) {
+ $res['error'] = sprintf("Could not parse: %s,%s", $lat, $lon);
+ return $res;
+}
# Find the way that is closes to the point in question
Please sign in to comment.
Something went wrong with that request. Please try again.