Page 3 of 4

Find if a map cords are withing a cycle

Posted: Tue Nov 04, 2014 10:17 pm
by Bruce Stuart

check this out ---- the error code implies you don't have an index on the field - so perhaps recreating the service may be the correct idea...

http://stackoverflow.com/questions/23...

also - it shows that there are some alternative ways to use the correct query....

let me know - if you don't get there with this query - I'll build the same table in a sample app and send it to you to compare...

Best,

Bruce


Find if a map cords are withing a cycle

Posted: Wed Nov 05, 2014 7:25 am
by Takis

Well, I looked at some other threads and I see that in the DB table columns if there is an index in geopoint it appears as

(columnName),idx

This does not appear in my DB, even after recreating the index several times.
I even tried to another column, but again the ",idx" part did not appear.

Appery team, is this how it supposed to be, is this a bug ?

Image


Find if a map cords are withing a cycle

Posted: Wed Nov 05, 2014 9:14 am
by Takis

Appery team can you please assist ?

Is the index created or not?
Should I see the ",idx" part in column where I created the index?


Find if a map cords are withing a cycle

Posted: Wed Nov 05, 2014 9:20 am
by Evgene Karachevtsev

Hello Panagiotis,

Sure, we are working on it at the moment and will get back to you with the update.


Find if a map cords are withing a cycle

Posted: Wed Nov 05, 2014 12:50 pm
by Takis

One more info
I went in the DB on the geopoint column and I just typed inside the
[23.793436,38.004065] as you see it here.

Is this OK or I should insert the values in some other way?


Find if a map cords are withing a cycle

Posted: Wed Nov 05, 2014 1:01 pm
by Evgene Karachevtsev

Panagiotis,

Would you kindly let me know what kind of index and idx is it? We don't have such.
Here is a documents about geopoint http://devcenter.appery.io/documentat...


Find if a map cords are withing a cycle

Posted: Wed Nov 05, 2014 1:51 pm
by Takis

I just want to create an index on a geopoint column.
See the picture above.
I press OK and it is supposed to be created, I do not get any error.
I am asking, if after creating the index, I should see in the DB GUI under the name of the column something like this
==================
(geopoint),idx
==================

Currently I do not see it. It just displays geopoint.

Any feedback about the error I get ?

A summary of what I created

==DB Table
Image

==Index on geopoint looks to be created
Image

==Query Service
Image

==Query geopoint test with where ={"CustomerGeoPoint1": {"$nearSphere": [23.791376,38.002788], "$maxDistanceInMiles": 1}}

Image


Find if a map cords are withing a cycle

Posted: Wed Nov 05, 2014 1:56 pm
by Takis

I am sure that at the end, the solution will be very simple....
Hope I be true !!!


Find if a map cords are withing a cycle

Posted: Wed Nov 05, 2014 6:33 pm
by Maryna Brodina

Hello!

You can manage indexes by clicking on manage indexes button http://devcenter.appery.io/documentat...

The problem is that you specify incorrect coordinates value [23.791376,38002788]

Latitude and longitude shouldn't be more than 180, but you specified 38002788 (with missing dot perhaps)


Find if a map cords are withing a cycle

Posted: Wed Nov 05, 2014 7:35 pm
by Takis

In my last update I say that I ue

{"CustomerGeoPoint1": {"$nearSphere": [23.791376,38.002788], "$maxDistanceInMiles": 1}}

Can someone make a simple test?
-One table with one geopoint column and put same test values.
-A database query service for this table
-Then go to the service Test tab and put in where clause the $neaSphere fuction
Is it working for you ?