iOS Question Geo location return wrong results

Discussion in 'iOS Questions' started by Shay, Mar 5, 2015.

  1. Shay

    Shay Well-Known Member Licensed User

    Hi

    I will have to write some data in hebrew due to hebrew street names
    I am using ilocation 1.20

    and the following code to send street and city name in order to get lat,lon
    Code:
    Dim LocationName As String
        
    'LocationName= Main.Street & " " & Main.Number & " , " & Main.City & " , ישראל"
        LocationName= Main.City & " "  & Main.Number & " " & Main.Street
        Geocoder1.ResolveAddress(LocationName)
    (as you can see I tried both ways to send the street name / city name)
    in both the results are wrong

    my city that I am entering: "פתח תקווה" which is first difference from Android since there I am putting "פתח תקוה" and here it require me to put double "ו" or it gives error
    (I tried in andoid double "ו" and it gives correct answer on both cases (1 or 2 vav)

    street:"ארלוזורוב"
    number: "20"

    the results that I am getting is from 2 different cities: see below:
    (which missing street name)

    פתח תקווה 20, נתניה, ישראל @ <+32.32377790,+34.86042210> +/- 100.00m, region CLCircularRegion (identifier:'<+32.32377790,+34.86042210> radius 49.93', center:<+32.32377790,+34.86042210>, radius:49.93m)

    פתח תקווה 20, הרצליה, ישראל @ <+32.15982600,+34.85057210> +/- 100.00m, region CLCircularRegion (identifier:'<+32.15982600,+34.85057210> radius 49.93', center:<+32.15982600,+34.85057210>, radius:49.93m)

    and this is the coordinate I am getting
    32.3237779, 34.8604221

    I check via http://www.latlong.net/
    the results from the web site is correct on many ways I tried it, which is:
    32.084935, 34.875742
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    The Geocoder object passes the address string as is to the native API. There isn't any way to change or control the results.
     
  3. Shay

    Shay Well-Known Member Licensed User

    Can you check my example and see the difference between B4A and B4i
    are they both use the same resource for GEO (maybe you need to make it as b4a)
    clearly there is a bug here.
    Can you please investigate, this is blocker to my app
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    There is no relation between B4A geocoder and B4i geocoder. B4i geocoder is based on an internal API. If there is a bug in the location it returns then only Apple can fix it.
     
  5. Shay

    Shay Well-Known Member Licensed User

    1. Is there a web site apple gives to check such issues (meaning to enter street / city and see what you get)
    2. Can you try it based on my example, to see we have issue here
    3. How can I (or you) open bug at Apple?
    4. in the meanwhile is there other way to get the geo data (maybe using some http request to web site)
     
  6. Erel

    Erel Administrator Staff Member Licensed User

  7. Shay

    Shay Well-Known Member Licensed User

    To replicate just run:
    Code:
    Geocoder1.Initialize("Geocoder1")
        Geocoder1.ResolveAddress(
    "ארלוזורוב 20 פתח תקווה")
    Code:
    Sub Geocoder1_Complete (Success As Boolean, Placemarks As List)
        
    If Success Then
            
    Dim Address As Placemark
            
    Dim i As Int
            
    For i=0 To Placemarks.Size-1
                
    Address=Placemarks.Get(i)
                
    Log(Address)
                
    Log("("&Address.lat&", "&Address.Lng&")")
            
    Next
        
    End If
    End Sub
     
  8. Erel

    Erel Administrator Staff Member Licensed User

    This is the value I get: (32.159826, 34.8505721)
     
  9. Shay

    Shay Well-Known Member Licensed User

  10. Erel

    Erel Administrator Staff Member Licensed User

    Sorry but no. This is a general iOS issue.

    If you like I can send you the relevant source code.
     
  11. Shay

    Shay Well-Known Member Licensed User

    ok, send me, I will review and try to find the bug
     
  12. Erel

    Erel Administrator Staff Member Licensed User

    OBJ is an object of type CLGeocoder *.
    Code:
    - (void)ResolveAddress:(NSString *)Address {
      [OBJ geocodeAddressString:
    Address completionHandler:^(NSArray *placemark, NSError *error){
      B4IList *p = [B4IList new];
      [p Initialize];
      
    if (placemark == nil) {
      [B4I shared].lastError = error;
      
    } else {
      [(NSMutableArray *) p.object addObjectsFromArray:placemark];
      }
      [B4IObjectWrapper raiseEvent:OBJ :@"_complete::" :@[@(placemark != nil), p]];
      }];
    }
    As I previously wrote it is not a bug in iLocation library. The code just calls the native geocodeAddressString method.
     
    Last edited: Mar 12, 2015
  13. Shay

    Shay Well-Known Member Licensed User

    bug opened at apple
    #20137377
    for now I am using google geo service, which gives correct results
     
    Erel likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice