PLEASE!! Support for GeoNames, OFFLINE search for citynames

Started by MaleSmurf, April 25, 2011, 09:16:52

0 Members and 4 Guests are viewing this topic.

MaleSmurf

Hi Menion!

I have one BIG wish and I think that there is not much coding necessary because it's just a "search function"...  ;)  Can you PLEEEEEAAAASE add support for GeoNames??? At //http://www.geonames.org/ you can download the placenames of all countries free of charge! For each country there exist an own file with the data. It's a simple txt-file... For every cityname there are several fields and also the latitude and longitude (in decimal degrees (wgs84)). So it would be easy to search for a city and place the map to the desired coordinates  :D. And this search could be done OFFLINE...

Menion, please think about it... this feature would push Locus again one step ahead of all other (offline) map apps!  8-)

@all Locus users
If you find this idea of an offline search  using GeoNames data usefull, then post it here to show Menion that this would be great and he gets an encouragement to add this soon...  :D

Locus is a funtastic app and therefore I bought the pro version. Thanks!!!


----------------------------------------------------------------------------
Here ist the readme from GeoNames...
----------------------------------------------------------------------------



Readme for Geonames.org :
=========================

This work is licensed under a Creative Commons Attribution 3.0 License,
see http://creativecommons.org/licenses/by/3.0/
The Data is provided "as is" without warranty or any representation of accuracy, timeliness or completeness.

The data format is tab-delimited text in utf8 encoding.


Files :
-------
XX.zip                   : features for country with iso code XX, see 'geoname' table for columns
allCountries.zip         : all countries combined in one file, see 'geoname' table for columns
cities1000.zip           : all cities with a population > 1000 (ca 80.000), see 'geoname' table for columns
cities5000.zip           : all cities with a population > 5000 (ca 40.000), see 'geoname' table for columns
cities15000.zip          : all cities with a population > 15000 (ca 20.000), see 'geoname' table for columns
alternateNames.zip       : two files, alternate names with language codes and geonameId, file with iso language codes
admin1Codes.txt          : names for administrative subdivision 'admin1 code' (UTF8), the code '00' stands for 'unkown code', includes obsolete codes
admin1CodesASCII.txt     : ascii names of admin divisions. (beta > http://forum.geonames.org/gforum/posts/ ... .page#1143)
admin2Codes.txt          : names for administrative subdivision 'admin2 code' (UTF8), Format : concatenated codes <tab>name <tab> asciiname <tab> geonameId
iso-languagecodes.txt    : iso 639 language codes, as used for alternate names in file alternateNames.zip
featureCodes.txt         : name and description for feature classes and feature codes
timeZones.txt            : timezoneId, gmt offset on 1st of January, dst offset to gmt on 1st of July (of the current year)
countryInfo.txt          : country information : iso codes, fips codes, languages, capital ,...
                           see the geonames webservices for additional country information,
                                bounding box                         : http://ws.geonames.org/countryInfo?
                                country names in different languages : http://ws.geonames.org/countryInfoCSV?lang=it
modifications-<date>.txt : all records modified on the previous day, the date is in yyyy-MM-dd format. You can use this file to daily synchronize your own geonames database.
deletes-<date>.txt       : all records deleted on the previous day, format : geonameId <tab> name <tab> comment.

alternateNamesModifications-<date>.txt : all alternate names modified on the previous day,
alternateNamesDeletes-<date>.txt       : all alternate names deleted on the previous day, format : alternateNameId <tab> geonameId <tab> name <tab> comment.
userTags.zip      : user tags , format : geonameId <tab> tag.
hierarchy.zip      : parentId, childId, type. The type 'ADM' stands for the admin hierarchy modeled by the admin1-4 codes. The other entries are entered with the user interface. The relation toponym-adm hierarchy is not included in the file, it can instead be built from the admincodes of the toponym.


The main 'geoname' table has the following fields :
---------------------------------------------------
geonameid         : integer id of record in geonames database
name              : name of geographical point (utf8) varchar(200)
asciiname         : name of geographical point in plain ascii characters, varchar(200)
alternatenames    : alternatenames, comma separated varchar(5000)
latitude          : latitude in decimal degrees (wgs84)
longitude         : longitude in decimal degrees (wgs84)
feature class     : see http://www.geonames.org/export/codes.html, char(1)
feature code      : see http://www.geonames.org/export/codes.html, varchar(10)
country code      : ISO-3166 2-letter country code, 2 characters
cc2               : alternate country codes, comma separated, ISO-3166 2-letter country code, 60 characters
admin1 code       : fipscode (subject to change to iso code), see exceptions below, see file admin1Codes.txt for display names of this code; varchar(20)
admin2 code       : code for the second administrative division, a county in the US, see file admin2Codes.txt; varchar(80)
admin3 code       : code for third level administrative division, varchar(20)
admin4 code       : code for fourth level administrative division, varchar(20)
population        : bigint (8 byte int)
elevation         : in meters, integer
gtopo30           : average elevation of 30'x30' (ca 900mx900m) area in meters, integer
timezone          : the timezone id (see file timeZone.txt)
modification date : date of last modification in yyyy-MM-dd format


AdminCodes:
Most adm1 are FIPS codes. ISO codes are used for US, CH, BE and ME. UK and Greece are using an additional level between country and fips code.



The table 'alternate names' :
-----------------------------
alternateNameId   : the id of this alternate name, int
geonameid         : geonameId referring to id in table 'geoname', int
isolanguage       : iso 639 language code 2- or 3-characters; 4-characters 'post' for postal codes and 'iata','icao' and faac for airport codes, fr_1793 for French Revolution names,  abbr for abbreviation, link for a website, varchar(7)
alternate name    : alternate name or name variant, varchar(200)
isPreferredName   : '1', if this alternate name is an official/preferred name
isShortName       : '1', if this is a short name like 'California' for 'State of California'


Remark : the field 'alternatenames' in the table 'geoname' is a short version of the 'alternatenames' table without links and postal codes but with ascii transliterations. You probably don't need both.
If you don't need to know the language of a name variant, the field 'alternatenames' will be sufficient. If you need to know the language
of a name variant, then you will need to load the table 'alternatenames' and you can drop the column in the geoname table.



Statistics on the number of features per country and the feature class and code distributions : http://www.geonames.org/statistics/


Continent codes :
AF : Africa         geonameId=6255146
AS : Asia         geonameId=6255147
EU : Europe      geonameId=6255148
NA : North America      geonameId=6255149
OC : Oceania      geonameId=6255151
SA : South America      geonameId=6255150
AN : Antarctica      geonameId=6255152


If you find errors or miss important places, please do use the wiki-style edit interface on our website
http://www.geonames.org to correct inaccuacies and to add new records.
Thanks in the name of the geonames community for your valuable contribution.

Data Sources:
http://www.geonames.org/data-sources.html


More Information is also available in the geonames faq :

http://forum.geonames.org/gforum/forums/show/6.page

The forum : http://forum.geonames.org

or the google group : http://groups.google.com/group/geonames
  •  

MaleSmurf

PUSH...  ;)

I'm stil hoping to see this offline search in Locus because again and again, we're searching for a city on a trip and every time we scroll the (TOPO) map around to find it...  :(

Would it be possible to write an addon for Locus which can do this?
  •  

Menion

yes, it should be possible to create addon for locus. are you skikled with android develloping and want to do this? i'll look at this during week. anyway i'm little worriend about speed of offline search ... to iterate through all lines and search nearest values ...
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

MaleSmurf

Hi Menion! Well, I would do this at once, but unfortunately I've no skills in programming anymore... 30 years ago I was always busy with programming.... It would be really great if you could try this. Don't worry about the speed. If the offline search takes some time, it doesn't matter because you need the search only for a short moment to move the map to another destination. No background task or something like this is needed...
  •  

Menion

OK, I have created concept, so I'll try something in next days ...
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

MaleSmurf

Wow, great news!
I just opened such a GeoName file with OpenOffice. Looks like a excel sheet... I searched for a city and found several entries because citynames are often the same in a country. Maybe you can show all the results in a window, sorted next to the actual location. This would be funtastic!
  •  

Menion

don't worry, I'll take care of it :)
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

Menion

oki, I'll release it directly into public market version. Anyway count that this really needs some improvements, so I expect feedback :)
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

MaleSmurf

Great... waiting for release, because I must stay at home (sick)  8-)
  •  

Menion

ok, first attempt is on market ...

anyway it have two problems

1. files have to be extracted so whole biggest file (whole world) takes cca 1GB!
2. searching in this text file (whole world) takes aroung 15 minutes ... it's almost 8 millions of lines

So much better should be to create from these information some binary and much faster format. Hmm ... anyway for small files, it's fast "enough"
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

MaleSmurf

#10
Hi Menion, I'll try it...
Well, I already saw this big file, but I don't think that this makes much sense. Nobody needs the whole world all the time...

Searching a city does work and the list which shows the distance of all results is exactly what is needed. But... when I select the name nothing happens and the map position is still the same... Oh, checked... you have to select the name and not the checkbox. But why are there checkboxes after each name?

Is it possible to show the capital letters of the city names? In the .txt files there are the names with a capital letter at the beginning.

When selecting the search button then Locus switches several times from full screen to not full screen and back to full screen which should be used...

GeoName search works already quite good !!
  •  

Menion

#11
fine, checkbox place point on map, when you want to store this location or see more places on map. When you click on left side of point (in list) you get dialog with map button that move you on place

I'll look on capital letters and on full screen problem, but I'm worried that fullscreen issue is old android unsolved problem
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

MaleSmurf

#12
Hmmm... that's the point why I asked about the checkbox. When I just set the ckeckbox, nothing happens. The map can only be moved through the map dialog...  ;)
  •  

Menion

#13
some problems were there still, fixed now
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

spawny

#14
Hi Menion,

another nice feature! Since the file size is too big for the whole world it would be nice to only store cities grouped by their countries. When searching for a city you have to choose the (offline available) country first. Maybe it would be also possible to download the country-file with the phone instead of the computer!?

Anyway ... always nice to see your updates coming!!!
  •