2014년 12월 14일 일요일

Fusion Tables, Map and wrong geocoding.

I'm trying to make app, and I have a problem :(

Basics task required :

- Set pseudo
- Set complet adress
- Geocoding Latitude and Longitude from the address
- Display map with dot anf info.

1st Issue
When I run the app, first thing I have is a runtime Error (see attach) Somebody understand where is the error ? That's probably why the app doesn't display any map

2nd Issue
i can retrieve my data on my fusiontables, I can see the dot on the map, BUT, coordonates are wrong !!! (see blocks on attach files)

I allready made the "pizza party" app, plus another one and everything was good, except that I had to manually geocode on fusiontables.
I read that's because we have to indicate coordonate instead address. And it's working ! But placing the dots at the wrongplace.
I checked the true coordonnate with that http://universimmedia.pagesperso-orange.fr/geo/loc.html


Does anyone got an idea ?
Thanks for your time Guys !





concerning the 1st issue, see the second block in your Screen.Initialize event
you probably want to set the Webviewer.HomeUrl property instead of the LocationSensor.DistanceInterval?



Thank you, but I correctly set the webviewer.go home.URL un the block "when screen 1 initialise".
Any other idea ? :-)



according to your screenshot you did not?
or are you saying, you corrected this now but you still get the runtime error?
probably you like to provide a new screenshot of your relevant blocks?



Hummmmm ! I'm feeling a little bit dumb rigth now :(
I was looking at the "call action", not the "set action".
You're probably right. I'll change it and tell you if it's good. Any lead on thé second issue ?



concerning the 2nd issue: use Do it to debug your blocks and to especially check, which coordinates you get



1st issue solved :-)

For the second one, there is no bug. It's just that the coordinate are not good. it's point to to a place in australia instead of france.
As I said before, I checked it when I compare the real coordonates and the one gived by the app. I check it with a label in the app and with the fusin tables.

Test:

Adress: 11 rue pierre brossolette 92400 COURBEVOIE
Gmap coordonates: 
LatitudeLongitude
48.90411212.2545911

App coordonates:
-27.66073                      150.0421

Thank you



are you saying, the location sensor gives you Australian coordinates for an address in France? can you provide a screenshot incl. Do it result?

see also Tip 4 here how Do it works: 

Top 5 Tips: How to learn  App Inventor




Here's an interesting note on Fusion Table geocoding and location storage ...

I haven't used this facility yet myself, but from a quick reading I
can try to guess a few things that might go wrong ...

  1. hitting the daily limit on geocoding
  2. not defining the table column as location type
  3. not waiting for Google to complete the geo-code operation
  4. not waiting for the gps device to complete?
  5. switching the lat/long order?
  6. some kind of data format or units error (EuroDegrees?) - grabbing at straws here ;P



Taifun, sorry for taking so long.

As you can see in the screenshot, the doitresult give 0.0 wich is normal.

And yes I confirm, it give me australian coordinates for an adress in France.
At the beginning I thouht that maybe there is a system of conversion to do bettwen US and European data, but wathever the adress is, I always get the same coordinates.
Tell me if I'm wrong, I generate an API key for the fusion tables, and I had allow this API key to access Reverse Geocoding too. So I have the same KEY for Fusion Tables an Geocoding.
Does there is any "LocationSensor" setting to do ?
Thank you for your time !




Unless you have this block


the LocationSensor will probably always report   0.0, 0.0

"give me australian coordinates for an adress in France."  .... How are you doing the geocoding?      



Abraham,

Thank You for your answer !
I already took a look at the note about Table and Geocoding.

  1. hitting the daily limit on geocoding                          I'm far away from the limits ... for now :-)
  2. not defining the table column as location type                     Definitions are good, it's the geocoding made by AI2 that goes wrong
  3. not waiting for Google to complete the geo-code operation                             you mean waiting in AI2 ? How can I do that ?
  4. not waiting for the gps device to complete?                               Same 
  5. switching the lat/long order?                                 No
  6. some kind of data format or units error (EuroDegrees?) - grabbing at straws here ;P Not that, because the result is always the same.                         So it's not a conversion problem



btw. 0.0 is not Australia, this is close to South West Africa... and 0.0 also means, no data available...



As SteveJG pointed out, you need to have event capture blocks
(in lieu of waiting) to hold your data reception blocks.



There is some progress !
Thanks to Taifun, I create a new variable "global TestAddress" to test the blocks
I can now see that that I get the good results from "set global Latitude" and "set global longitude".
The probleme come after that, when I try to "set global Geocode" because it's returning blanks results !

So, the australian results must come from a bad interpretation by fusion tables.
But why, that's the question !! :-)
Thanks.




@Steve, I'm not doing geocoding, I'm doing reverse Geocoding.

As you can see in the screen shot, I use LatitudeFromAddress.
I want the users set his address and the app able to send coordinate to fusion tables.
I give you the aia file, it's test app, so very small.

thanks for your time !




ok, this is becomming very strange ! 

As I'm talking to you guys, I'm understanding a little bit what's going on.
As you can see on the new "Do it result" Longitude Data is not working ????

And as you can see on the fusion tables screenshot, the data stock in the fusion tables are totally different from the ones obtained with the "do it result" 

Thanks again for your helping me understand what's going on here !





From the lack of DoIt bubbles on the SET blocks in your screen shot,
I would guess that you DoIt-ed the CALL blocks to get latitude,
but never assigned the results into the global variables?



it would help to have the Do it result of the insert statement
then after executing the query, compare the values form the Do it result with the values in the table



@Taifun: When I try to get the do it result, I get nothing. Only the fusion tables on my phone and I can see that the Global TestAddress is writed in the table fusion.

@ABG: What do you mean by "assign to global Variable" ? I set the Global Latitude to get the reverse geocoding and it's working. But it's not for the longitude.

To be short:

I'm able to get the rigth latitude but not the longitude (thx Taifun)
If i send text to fusion table, it's work, but if it's latitude or longitude, it's transforme the value to always the same... in Australia !



see screenshot about Do it, see also tip 4 here 

Top 5 Tips: How to learn  App Inventor

and as already said,  0.0 is not Australia, this is close to South West Africa... and 0.0 also means, no data available...



Ok All !

I'm good ! Thanks a lot for your help... It's thanks to you if it's working now !

I can say for the future users that I know able to make an app were users can enter their own address and see all the other users !
Avaible for anyone who need help !


댓글 없음:

댓글 쓰기