I am trying to get all the countries data which have feature code "RGN" and FeatureClass "L".
Is my code is corerct or do i need to add some other filter as well.
When i try to print no of information from every record , it gives feature Class name null and also admin codes as nul values.
As well as it does not give all number of RGN record from allcountris.txt.
Can somebody help me in understanding this java client.
Does this Toponym retrieving data from allcountries.txt or some othe file.
this is the code which i tried to execute
ToponymSearchCriteria searchCriteria = new ToponymSearchCriteria();
searchCriteria.setFeatureClass(FeatureClass.L);
searchCriteria.setFeatureCode("RGN");
ToponymSearchResult searchResult = WebService.search(searchCriteria);
for (Toponym toponym : searchResult.getToponyms()) {
You have to set the style to 'FULL' if you want to access more parameters. The method is accessing the web services and does not stream. If only gets a certain number of rows. You can set the number of rows and you will have to implement paging if you want to access more records.
Can you please clarify the second part of answer.
I mean how can i get whole of records out of allcountries.txt using toponyms.is there aby other way than pagination?
with my code i am getting only first 100 records. i want all the records so that i can analyse all region information.
i am just using system.out.pintln for printing all so that i can use that retrived data on console for analysing.
If you want to retrieve all the records you will have to download the dump to your computer and work with it locally. The API is accessing the webservice and only returns a finite number of rows per request. (set with maxRows and startRow)