Package org.geonames

Examples of org.geonames.ToponymSearchResult


    try {
      ToponymSearchCriteria searchObj = new ToponymSearchCriteria();
      searchObj.setMaxRows(1);
      searchObj.setQ(searchString);
      logger.debug("search criteria: " + searchObj);
      ToponymSearchResult result = WebService.search(searchObj);
      if (result != null && result.getTotalResultsCount() > 0) {
        Toponym topo = result.getToponyms().get(0);
        geo = new Geo(topo.getLatitude(), topo.getLongitude());
      }
    } catch (Exception e) {
      logger.debug("search geo failed: original geoString=" + geoString
          + ", actual searchString=" + searchString, e);
View Full Code Here


   * @param style style
   * @return a list of places
   */
  public static List<Toponym> readLocationForKeyword(String q, Style style) {
    List<Toponym> list = new ArrayList<Toponym>();
    ToponymSearchResult locationSearchResult;
    ToponymSearchCriteria searchLocation = new ToponymSearchCriteria();
    searchLocation.setMaxRows(7);
    searchLocation.setFeatureClass(FeatureClass.P);
    searchLocation.setStyle(style);
    searchLocation.setQ(q);
    try {
      WebService.setUserName("erudika");
      locationSearchResult = WebService.search(searchLocation);
      if (locationSearchResult != null) {
        list.addAll(locationSearchResult.getToponyms());
      }
    } catch (Exception ex) {
      logger.error(null, ex);
    }
    return list;
View Full Code Here

   * @param style style
   * @return a list of places
   */
  public static List<Toponym> readLocationForKeyword(String q, Style style) {
    List<Toponym> list = new ArrayList<Toponym>();
    ToponymSearchResult locationSearchResult;
    ToponymSearchCriteria searchLocation = new ToponymSearchCriteria();
    searchLocation.setMaxRows(7);
    searchLocation.setFeatureClass(FeatureClass.P);
    searchLocation.setStyle(style);
    searchLocation.setQ(q);
    try {
      WebService.setUserName("erudika");
      locationSearchResult = WebService.search(searchLocation);
      if (locationSearchResult != null) {
        list.addAll(locationSearchResult.getToponyms());
      }
    } catch (Exception ex) {
      logger.error(null, ex);
    }
    return list;
View Full Code Here

    if (searchEvent == true) {
      searchCriteria.setQ(searchName);

      try {
        ToponymSearchResult searchResult = WebService.search(searchCriteria);

        for (Toponym toponym : searchResult.getToponyms()) {
          println(toponym.getName() + " " + toponym.getCountryName() + " " + toponym.getLongitude() + " "
              + toponym.getLatitude() + " " + toponym.getFeatureClass());

          loc.x = (float) toponym.getLatitude();
          loc.y = (float) toponym.getLongitude();
View Full Code Here

    // GEONAMES EVENT
    if (searchEvent == true) {
      searchCriteria.setQ(myTextfield.getStringValue());

      try {
        ToponymSearchResult searchResult = WebService.search(searchCriteria);

        for (Toponym toponym : searchResult.getToponyms()) {
          println(toponym.getName() + " " + toponym.getCountryName() + " " + toponym.getLongitude() + " "
              + toponym.getLatitude() + " " + toponym.getFeatureClass());

          loc.x = (float) toponym.getLatitude();
          loc.y = (float) toponym.getLongitude();
View Full Code Here

   * @param style style
   * @return a list of places
   */
  public static List<Toponym> readLocationForKeyword(String q, Style style) {
    List<Toponym> list = new ArrayList<Toponym>();
    ToponymSearchResult locationSearchResult;
    ToponymSearchCriteria searchLocation = new ToponymSearchCriteria();
    searchLocation.setMaxRows(7);
    searchLocation.setFeatureClass(FeatureClass.P);
    searchLocation.setStyle(style);
    searchLocation.setQ(q);
    try {
      WebService.setUserName("erudika");
      locationSearchResult = WebService.search(searchLocation);
      if (locationSearchResult != null) {
        list.addAll(locationSearchResult.getToponyms());
      }
    } catch (Exception ex) {
      logger.error(null, ex);
    }
    return list;
View Full Code Here

   * @param style style
   * @return a list of places
   */
  public static List<Toponym> readLocationForKeyword(String q, Style style) {
    List<Toponym> list = new ArrayList<Toponym>();
    ToponymSearchResult locationSearchResult;
    ToponymSearchCriteria searchLocation = new ToponymSearchCriteria();
    searchLocation.setMaxRows(7);
    searchLocation.setFeatureClass(FeatureClass.P);
    searchLocation.setStyle(style);
    searchLocation.setQ(q);
    try {
      WebService.setUserName("erudika");
      locationSearchResult = WebService.search(searchLocation);
      if (locationSearchResult != null) {
        list.addAll(locationSearchResult.getToponyms());
      }
    } catch (Exception ex) {
      logger.error(null, ex);
    }
    return list;
View Full Code Here

   * @param style style
   * @return a list of places
   */
  public static List<Toponym> readLocationForKeyword(String q, Style style) {
    List<Toponym> list = new ArrayList<Toponym>();
    ToponymSearchResult locationSearchResult;
    ToponymSearchCriteria searchLocation = new ToponymSearchCriteria();
    searchLocation.setMaxRows(7);
    searchLocation.setFeatureClass(FeatureClass.P);
    searchLocation.setStyle(style);
    searchLocation.setQ(q);
    try {
      WebService.setUserName("erudika");
      locationSearchResult = WebService.search(searchLocation);
      if (locationSearchResult != null) {
        list.addAll(locationSearchResult.getToponyms());
      }
    } catch (Exception ex) {
      logger.error(null, ex);
    }
    return list;
View Full Code Here

   * @param style style
   * @return a list of places
   */
  public static List<Toponym> readLocationForKeyword(String q, Style style) {
    List<Toponym> list = new ArrayList<Toponym>();
    ToponymSearchResult locationSearchResult;
    ToponymSearchCriteria searchLocation = new ToponymSearchCriteria();
    searchLocation.setMaxRows(7);
    searchLocation.setFeatureClass(FeatureClass.P);
    searchLocation.setStyle(style);
    searchLocation.setQ(q);
    try {
      WebService.setUserName("erudika");
      locationSearchResult = WebService.search(searchLocation);
      if (locationSearchResult != null) {
        list.addAll(locationSearchResult.getToponyms());
      }
    } catch (Exception ex) {
      logger.error(null, ex);
    }
    return list;
View Full Code Here

TOP

Related Classes of org.geonames.ToponymSearchResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.