kercos / geomodel

Automatically exported from code.google.com/p/geomodel
0 stars 0 forks source link

GeoModel 0.0.8 for java seems don't work... #31

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hello,

I'm using GeoModel API for java in version 0.0.8 for my GAE project.
In my google app engine database, I have 10 000 entities which are coord. GPS :
    @Persistent
    @Geocells
    private List<String> geocells = null;

    @Persistent
    @Latitude
    private Double latitude = null;

    @Persistent
    @Longitude
    private Double longitude = null;

Each entity has a list of geocells built by : "geocells = 
GeocellManager.generateGeoCell(pt);"
You can see the screen capture in the dataViewer.PNG file...

I want to lauch a request to find all entities in a radius of 40km for example. 
The result is always empty !!!! :-( :-(.

Example of code in a servlet :

int radiusInKm = 40;
int nbMaxResults = 10000;
Point pointOfMarseille = new Point(43.295262d, 5.374049d);

final PersistenceManager pm = PMF.get().getPersistenceManager();

try {
    pm.currentTransaction().begin();

    GeocellQuery baseQuery = new GeocellQuery();

    // we want all entities in the radius 
    long start = System.currentTimeMillis();
    List<MyEntity> res = GeocellManager.proximitySearch(pointOfMarseille, nbMaxResults, radiusInKm * 1000.0d, MyEntity.class, baseQuery, pm);
    long end = System.currentTimeMillis();

        LOGGER.info(res.size() + " element(s) found(s) in a radius of " + radiusInKm + " km around of Marseille city for maxResults : " + nbMaxResults + " (in " + (end - start)/1000.0d + " sec.)");

    pm.currentTransaction().commit();
} catch (Exception e) {
    pm.currentTransaction().rollback();
    throw new RuntimeException(e);
} finally {
    if (!pm.isClosed()) {
        pm.close();
    }
}

My queries return always empty and I don't understand.
Can you help me ?

Thanks a lot,
F.

Original issue reported on code.google.com by fabien.p...@gmail.com on 2 Aug 2011 at 10:13

Attachments:

GoogleCodeExporter commented 8 years ago
In logs of my GAE application, I can see many times the same line :

2011-08-02 02:34:28.115

com.beoui.geocell.GeocellManager proximitySearch: Discarding result 
fr...................MyEntity@9e0916bc because distance 4849286.947752636m > 
max distance 30000.0m

I 2011-08-02 02:34:28.115

com.beoui.geocell.GeocellManager proximitySearch: Discarding result 
fr...................MyEntity@3627e9de because distance 4849286.947752636m > 
max distance 30000.0m

I 2011-08-02 02:34:28.115

com.beoui.geocell.GeocellManager proximitySearch: Discarding result 
fr...................MyEntity@ce46bd00 because distance 4849286.947752636m > 
max distance 30000.0m

I 2011-08-02 02:34:28.115

com.beoui.geocell.GeocellManager proximitySearch: Discarding result 
fr...................MyEntity@66659037 because distance 4849286.947752636m > 
max distance 30000.0m

It's silly, the distance between my point (Marseille city) and each entity 
seems to be the same...

Original comment by fabien.p...@gmail.com on 2 Aug 2011 at 10:19

GoogleCodeExporter commented 8 years ago
In my first post, you must putting : "int nbMaxResults = 20;" and no "int 
nbMaxResults = 10000;"

Original comment by fabien.p...@gmail.com on 2 Aug 2011 at 10:35

GoogleCodeExporter commented 8 years ago
I  am having same issue ... Did you solved it ?

Original comment by bha...@gmail.com on 11 Sep 2011 at 10:36

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Just to Give the details

using JPA

0.0.8 Version

Code
Point center = new Point(20.0, 12.4)
 EntityManager em = EMF.get().createEntityManager();
 GeocellQuery baseQuery = new GeocellQuery("SELECT id FROM GeoEntity");
 List<GeoEntity> objects = null;
try {
       objects = GeocellManager.proximitySearch(center, 40, 0, GeoEntity.class, baseQuery, em);
 } catch (Exception e) {

No exception no data returned tested locally .
Any response will be greatly appreciated.

Original comment by bha...@gmail.com on 12 Sep 2011 at 12:01

Attachments:

GoogleCodeExporter commented 8 years ago
I'm sorry but I didn't get an answer...
You should use an another API or change the language.

Original comment by fabien.p...@gmail.com on 12 Sep 2011 at 6:53

GoogleCodeExporter commented 8 years ago
Have you solved this problem??
What about another api??

Thanks

Original comment by correo.c...@gmail.com on 5 Dec 2011 at 9:16

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Any Solution on this ??? have it worked for any one... It will be a great help 
from you if you can update the thread.

Original comment by satishba...@gmail.com on 17 Jul 2013 at 9:59