Google Maps API - geocoding accuracy chart? - google-maps

Where in the Google Maps API docs can I find a table explaining the accuracy values of Geocode lookups?
Has the range of values changed in between V2 and V3?

Here are the Google Maps API Docs. It contains a table with accuracy values...
http://code.google.com/apis/maps/documentation/reference.html#GGeoAddressAccuracy
Constant | Description
0 Unknown location.
1 Country level accuracy.
2 Region (state, province, prefecture, etc.) level accuracy.
3 Sub-region (county, municipality, etc.) level accuracy.
4 Town (city, village) level accuracy.
5 Post code (zip code) level accuracy.
6 Street level accuracy.
7 Intersection level accuracy.
8 Address level accuracy.
9 Premise (building name, property name, shopping center, etc.) level accuracy.

Here are the real status answers from geocoder:
You can output the status inside your geocoding function:
myMap.geocoder.geocode(
{ address: someAdress } ),
function ( responses, status ) {
console.log( status );
}
);
When passing the status, you can switch those four values:
switch ( status )
{
case 'ROOFTOP' :
var precision = 'precise';
break;
case 'RANGE_INTERPOLATED' :
var precision = 'interpolated';
break;
case 'APPROXIMATE' :
var precision = 'approximately';
break;
case 'ZERO_RESULTS' :
var precision = 'no address';
break;
}

#Pekka
I don't know if you saw, but V3 does not include accuracy anymore. It seems that there is a different way though. If you add the results of the address_component elements you get a similar result. Disclaimer: I am not 100% sure about this but it looks like that they included the accuracy this way. I am currently doing some testing is this the way to go.
Here an example:
I searched for: 555 Pearl Street, Boulder
Here the result with Address Level accuracy (8 levels deep).
[address_component] => Array
(
[0] => SimpleXMLElement Object
(
[long_name] => 555
[short_name] => 555
[type] => street_number
)
[1] => SimpleXMLElement Object
(
[long_name] => Pearl St
[short_name] => Pearl St
[type] => route
)
[2] => SimpleXMLElement Object
(
[long_name] => Boulder
[short_name] => Boulder
[type] => Array
(
[0] => locality
[1] => political
)
)
[3] => SimpleXMLElement Object
(
[long_name] => Boulder
[short_name] => Boulder
[type] => Array
(
[0] => administrative_area_level_3
[1] => political
)
)
[4] => SimpleXMLElement Object
(
[long_name] => Boulder
[short_name] => Boulder
[type] => Array
(
[0] => administrative_area_level_2
[1] => political
)
)
[5] => SimpleXMLElement Object
(
[long_name] => Colorado
[short_name] => CO
[type] => Array
(
[0] => administrative_area_level_1
[1] => political
)
)
[6] => SimpleXMLElement Object
(
[long_name] => United States
[short_name] => US
[type] => Array
(
[0] => country
[1] => political
)
)
[7] => SimpleXMLElement Object
(
[long_name] => 80302
[short_name] => 80302
[type] => postal_code
)
)

Related

mysql cant save my big decimal number

I have a number like this
34.59704151614417
and I put datatype on decimal(16,14) but it has saved as 34.59704151614400
it means mysql save just 12 digit decimal
this is my array
Array
(
[geometry] => Array
(
[type] => Polygon
[coordinates] => Array
(
[0] => Array
(
[0] => Array
(
[0] => 32.34375
[1] => 48.690960390925
)
[1] => Array
(
[0] => 16.875
[1] => 34.597041516144
)
[2] => Array
(
[0] => 43.2421875
[1] => 31.653381399664
)
[3] => Array
(
[0] => 64.3359375
[1] => 40.97989806962
)
[4] => Array
(
[0] => 32.34375
[1] => 48.690960390925
)
)
)
)
)
I understand
after I do json_decode of my array it reduce it's digit to 12 number
Set precision directive:
ini_set('precision', 16);
It is currently 14 and that's why the decimals get reduced. Check this link about more information

how to combine mysql query in CodeIgniter

I need to combine those two array into a single array.
1st query result
Array ( [0] => stdClass Object ( [p_type] => Bank [tsales] => 131000 [tdues] => 55000 [tpaid] => 75000 ) [1] => stdClass Object ( [p_type] => Cash [tsales] => 104000 [tdues] => 50000 [tpaid] => 54000 ) [2] => stdClass Object ( [p_type] => bKash [tsales] => 25000 [tdues] => 10000 [tpaid] => 5000 ) [3] => stdClass Object ( [p_type] => Pause [tsales] => 4000 [tdues] => 1000 [tpaid] => 2000 ) )
2nd query result
Array ( [0] => stdClass Object ( [dpayment] => 1000 ) [1] => stdClass Object ( [dpayment] => 5000 ) [2] => stdClass Object ( [dpayment] => 1000 ) [3] => stdClass Object ( [dpayment] => 5000 ) )
try to use array_merge. That should be very easy.
Your query result shows that you using $query->result() to get the value,
Instead of using result(), use $query->row_array();
then you get single dimensional array for both queries
then use array_merge() that would be easy

Import.io JSON Data import to MySQL DB

I am trying to connect to and get data from my import.io extractor. I am then trying to import the data to a MySQL database. I have been following the example given here: http://support.import.io/knowledgebase/articles/511605-extractor-to-sql-database but I am unable to get any data into my database for some reason. Any help resolving this would be very helpful. Below is some additional information.
Below is the output when I run the commands found in the tutorial which have been modified a bit for my personal use.
./importSQL.py
CONFIG FOUND, YAY!
{u'username': u'dmhumph_dmhumph', u'database': u'dmhumph_WATERFOWLGEARFINDER', u'inputUrl': u'https://www.rogerssportinggoods.com/decoys/avery-greenhead-gear-decoys/full-body-goose.html', u'mapping': {u'product_name/_text': u'product_name', u'image/_alt': u'product_name2', u'image': u'image', u'availability': u'availability', u'price': u'price', u'product_name/_title': u'product_name3', u'product_name': u'link'}, u'host': u'localhost', u'table': u'FullBodyGeese', u'ioAPIKey': u'<API-Key-Here>', u'password': u'<Password-Here>', u'sourceUUID': u'<Source-UUID-Here>', u'port': 3306, u'ioUserID': u'<IO-User-ID-Here>'}
Recieved 1 rows of data
product_name, product_name2, image, availability, price, product_name3, link
Mappings: {u'product_name/_text': u'product_name', u'image/_alt': u'product_name2', u'image': u'image', u'availability': u'availability', u'price': u'price', u'product_name/_title': u'product_name3', u'product_name': u'link'}
Below is a sample of the data returned when I just go out and get the data from the same extractor and dump it to a file:
stdClass Object
(
[offset] => 0
[results] => Array
(
[0] => stdClass Object
(
[product_name/_text] => Avery GHG Tim Newbold Lesser Canadas Sleeper 4 Pack
[image] => https://www.rogerssportinggoods.com/media/catalog/product/cache/1/small_image/210x/9df78eab33525d08d6e5fb8d27136e95/A/V/AV-72322-550.png
[price] => Regular Price: $99.99 Special Price $44.99
[availability] => Out of stock
[image/_alt] => Avery GHG Tim Newbold Lesser Canadas Sleeper 4 Pack
[product_name] => https://www.rogerssportinggoods.com/decoys/avery-greenhead-gear-decoys/full-body-goose/avery-ghg-tim-newbold-lesser-canadas-sleeper-4-pack.html
[product_name/_title] => Avery GHG Tim Newbold Lesser Canadas Sleeper 4 Pack
)
[1] => stdClass Object
(
[product_name/_text] => Avery GHG 72302 Tim Newbold Fully Flocked Lesser Canadas Sleepers
[image] => https://www.rogerssportinggoods.com/media/catalog/product/cache/1/small_image/210x/9df78eab33525d08d6e5fb8d27136e95/A/V/AV-72302-550.png
[price] => Regular Price: $129.99 Special Price $69.99
[availability] => Out of stock
[image/_alt] => Avery GHG 72302 Tim Newbold Fully Flocked Lesser Canadas Sleepers
[product_name] => https://www.rogerssportinggoods.com/decoys/avery-greenhead-gear-decoys/full-body-goose/avery-ghg-tim-newbold-fully-flocked-lesser-canadas-sleepers.html
[product_name/_title] => Avery GHG 72302 Tim Newbold Fully Flocked Lesser Canadas Sleepers
)
[2] => stdClass Object
(
[product_name/_text] => Greenhead Gear Pro Grade Series Full Body Canada Goose Decoys
[image] => https://www.rogerssportinggoods.com/media/catalog/product/cache/1/small_image/210x/9df78eab33525d08d6e5fb8d27136e95/A/V/AV-71446-500.png
[price] => Regular Price: $139.99 Special Price $89.99
[availability] => Out of stock
[image/_alt] => Greenhead Gear Pro Grade Series Full Body Canada Goose Decoys
[product_name] => https://www.rogerssportinggoods.com/decoys/avery-greenhead-gear-decoys/full-body-goose/greenhead-gear-pro-grade-series-full-body-canada-goose-decoys.html
[product_name/_title] => Greenhead Gear Pro Grade Series Full Body Canada Goose Decoys
)
)
[cookies] => Array
(
[0] => frontend="q7jjmij9u3jlnh505vl2d1oa45";Path="/";Domain="www.rogerssportinggoods.com";Port="443"
[1] => CATEGORY_INFO="%5B%5D";Path="/";Domain="www.rogerssportinggoods.com";Port="443"
[2] => LAST_CATEGORY="70";Path="/";Domain="www.rogerssportinggoods.com";Port="443"
)
[connectorVersionGuid] => 44b6228b-c59c-47a0-8cbf-458fabe5d77d
[connectorGuid] => 4a60b47a-b973-4e51-8e15-47cf81fb1858
[pageUrl] => https://www.rogerssportinggoods.com/decoys/avery-greenhead-gear-decoys/full-body-goose.html
[outputProperties] => Array
(
[0] => stdClass Object
(
[name] => product_name
[type] => URL
)
[1] => stdClass Object
(
[name] => image
[type] => IMAGE
)
[2] => stdClass Object
(
[name] => price
[type] => STRING
)
[3] => stdClass Object
(
[name] => availability
[type] => STRING
)
)
)

Sort array (stdClass Object)

Getting this result after array_merge of 2 arrays:
Array ( [0] => stdClass Object ( [tid] => 3954 [name] => Alleman )
[1] => stdClass Object ( [tid] => 3958 [name] => Jack )
[2] => stdClass Object ( [tid] => 3963 [name] => Aquin Catholic ));
I want to sort the array by [name]. I have been reading and searching for hours but cannot figure out how to sort passed the stdClass Object to [name].
Have tried sort, ksort, uasort, etc. wont sort passed the stdClass Object to [name].
Example
function compareItems($a, $b)
{
if ( $a->name < $b->name ) return -1;
if ( $a->name > $b->name ) return 1;
return 0; // equality
}
uasort($players, "compareItems");

Select statement not returning all values

This function works fine, what is flipping me out is that the array returned has all the information needed except $row[15] which has data in it on the table Orders
function SelectOrder($orderid)
{
connect();
$result = mysql_query("SELECT * FROM `Orders` WHERE `OrderID` =".$orderid." LIMIT 0 , 30");
$row = mysql_fetch_row($result);
return $row;
}
print_r($row);
Prints
Array ( [0] => 24
[1] => Grei
[2] => Tristram
[3] => 19 2nd Blvd.
[4] => Richmond
[5] => J7V 5R6
[6] => Ontario
[7] => Canada
[8] => grei#email.ca
[9] => (514) 555-5555
[10] => Snow Removal
[11] => 210
[12] => 32.5
[13] => 23.07
[14] => 200.57
[15] =>
[16] => 123 same street
[17] => 1
[18] => 0 )
When I use the same select statement within PHPMyAdmin
SELECT *
FROM `Orders`
WHERE `OrderID` = 24
LIMIT 0 , 30
I get value [15] (SNAME = Frank Ditripani)
PHPMyAdmin SQL Results
OrderID-Fname-Lname-Address-City-Pcode-Prov-Country-Email-Phone-Service-Price-Discount-Tax PYMNTAmount-SNAME-SADD-Agreed-PayPalPaid
24-Grei-Tristram-19 2nd Blvd.-Richmond-J7V 5R6-Ontario-Canada-grei#email.ca-(514) 555-5555-Snow Removal-210-32.5-23.07-200.57-Frank Ditripani-123 same street-1-0
Both SNAME and SADD are the exact same properties in the table which is varchar(50) and SADD is returned but not SNAME.
This is the first time I have ever posted a question I usually find my answers here but this one is driving me nuts! and I am a bit embarrassed as the answer is probabley an easy one.
The query might be the same, but is the database the same?
Check that you are connecting to the same database!
My bet is the connection parameters are different for the two programs.
Check the connection character set - DB, client and connection should use the same one.