0
votes

I am doing a website about places to visit using java, gwt, gae, gwt-platform and objectify for the datastore and GWT maps V3 [github.com/twistedpair/GWT-Maps-V3-Api]. (I don't know if is the best solution but for now im advancing, slowly but ok :))

Question: What you think can be the best approach to store latitude and longitude of a place being able later to search places near it?

I was trying the approach to save the longitude and latitude into strings using lexicographical order using http://code.google.com/p/sappenin/source/browse/trunk/SappeninUtils/src/main/java/com/sappenin/util/BigDecimalStringCodec.java?r=146 But I didn't achieve to get it working and as I understand, I would have to query first by latitude and then by longitude and I think it wont be practical at all.

I don't know if is better to use GeoPt in my entities or only the values latitude and longitude as two strings or long (as bigdecimal is not supported). I think will be more or less the same because internally GeoPt is the same, two numbers.

I think the best approach will be geomodel but is in python then I started to check http://code.google.com/p/javageomodel/ But I couldn't manage, the problem is that geomodel is not for objectify. I found an approach of javageomodel for objectify but seems quite old. [github.com/bfuster/javageomodel] I would try to take the original javageomodel and try to modify it but I wanted to know if someone knows a better way to do this.

Which option you recommend? Maybe there is a very easy way to do it now in 2012 but I couldn't find it and I'm rounding around one week through Google.

Thank you in advance for your opinion!

I hope the question is more or less clear because as you can see, I have a huge mess in my mind right now, ;)

1
just an advice, if you plan to release a hobby application hosted for free on GAE, take care about quotas. datastore read operations on gwt appli using google maps can make your app in quota exceed in a very short time even with almost nobody :-(Overnuts
Thank you for the advise!, yes, I saw already that things are growing fast and even is not working the website. For now is the final project of the university and I already said I will use this technologies but if it works somehow, I will have to make quite a lot of changes to try to spend as few as I can and also to pay less.Dani V.T.
I get this problem, quotas were reached with only bots activity ! So I rewrited GAE things to tomcat/mysql stuff, now, the app is hosted at home :-)Overnuts
You should make the GWT clients do the geo queries if possible, so it does not add up to your quota.koma
I'm trying it, I can make geocode queries or google maps queries by the client, but still I will have to query my datastore to fetch the nearest places, :s, We will see how it goes, ;)Dani V.T.

1 Answers

1
votes

You can find an example of how to use geohashing with GAE and Objectify here:

https://github.com/stickfigure/motomapia

The demo is here:

http://www.motomapia.com/

The geohash library is here:

http://code.google.com/p/javageomodel/