Import json using dashboard is not making the entry as geospatial

0 votes

Hello

I am using the dashboard to import json file to the storage. I am using the following

{ "results": [{ "loc":"[45.374259, -75.641260]", "Award":200}]}

I can see the entry there on the storage . However, when I do the following call from code

     double lat = loc.getLatitude();
     double lng = loc.getLongitude();
    BigDecimal distanceInKM = new BigDecimal(radius);   
        GeoTag gp = new GeoTag();  
        gp.setLat(new BigDecimal(lat));  
        gp.setLng(new BigDecimal(lng));  
        GeoQuery query = QueryBuilder.buildGeoQuery(gp, GeoOperator.NEAR, 10); //10 km  
        // find documents by geo query.  
         
        storageService.findDocumentsByLocation(dbName, collectionName_boxes, query, new App42CallBack() {  ...}
Then it is only returning the entries that I inserted manually using "save json" but not returning the ones  I imported using the json document.
 
What should I do? I know the Geos are within 1 km
 
Thanks
 
asked Feb 3, 2016 in Android by AndroidFolk (107 points)

1 Answer

0 votes

Hi AndroidFolk,

Data inserted through Import JSON feature is not going to add lat, long in No-SQL Storage service. It will import all values as a JSON documents if you need to add lat, long then you have to write a script on your local machine. 

Let me know if you need any help while writing it. I will be Happy to assist you. 

Regards,

Himanshu Sharma

 

 

answered Feb 4, 2016 by hs00105 (2,005 points)
Thank you Himanshu. I want to point out that  when I do the import feature, I see that it got the loc correct and put it in the loc column (lat, lng) and not as json doc though. It just the query does not recognize the values of that entry
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...