Menu

GeoDB Cities API

Shiny New Places Endpoints

GeoDB now supports the concept of a place. A place is any populated area and can currently be one of the following types:

  • An administrative level-2 district (ADM2)
  • A city or town (CITY)
  • An island (ISLAND)

As part of this evolution, the following new endpoint operations are now available:

With the addition of the ISLAND place type, GeoDB now gives you access to almost 700,000 places. Enjoy!

Performance Improvements And Duplicate Removal

GeoDB has recently undergone the following major improvements:

  • DB query optimizations together with LRU caching
  • JVM garbage collection tuning
  • Migration to a GCP Kubernetes 3-node regional cluster
  • Import algorithm updates to remove places with the same name occurring within a localized radius of each other

This has resulted in:

  • Significantly improved backend latencies averaging less than 100 milliseconds (in addition to less variability around the average)
  • Virtual elimination of duplicate-named places within a given locality

Further latency improvements will be made as new regional clusters are stood up to service continually growing usage.

 

Thank you for your support and looking forward to seeing all the ways you put the service to use...and Merry Christmas!

More Regions, More Cities, Merry Christmas!

GeoDB has been expanded with dependent territories (and their cities) for the following countries:

  • Australia
  • Denmark
  • France
  • Netherlands
  • UK
  • US

In addition, the country-details endpoint now includes calling codes.

 

Have a blessed Christmas! (Or whatever you celebrate :)) Stay healthy and on your path.

More Data, More Functionality

GeoDB now pulls in many new small cities and towns, for a total of over 525,000 populated places. As part of this update, you may now see cities with zero population. This usually just means the population data is currently not available from GeoNames/Wikipedia (but it could also mean you're seeing a ghost town).

In addition, you now have an easy way to find a city's containing adninistrative region (for example, its county or other local administrative division).

For example, to get the containing county for Los Angeles:

GET https://wft-geo-db.p.rapidapi.com/v1/geo/cities/Q60/locatedIn

Please see the docs on this new endpoint for further details.

GraphQL Is Here!

GeoDB now supports GraphQL queries. GraphQL is a relatively new technology, originally developed by Facebook as an efficient way of querying the complex relationships inherent in their social domain model.

GraphQL's primary advantage over REST is the ability to get back exactly what you want - and only what you want - in a single request.

For example, this query gets back the US flag image URI, its region names, and the names and populations of the cities in each region, with the regional cities sorted by larger population first:

{
  country(id:"US") {
    name
    flagImageUri
    regions(first:3) {
      totalCount
      pageInfo {
        startCursor
        endCursor
        hasNextPage
      }
      edges {
        node {
          wikiDataId
          name
          populatedPlaces(types:["CITY"], sort:"-population", first:3) {
            totalCount
            pageInfo {
              startCursor
              endCursor
              hasNextPage
            }
            edges {
              node {
                id
                wikiDataId
                name
                population
              }
            }
          }
        }
      }
    }
  }
}

The REST version of this would require one request to get the country details, one to get the regions, one for each region to get its cities (3), then one for each city to get its population details (9) - for a total of 14 requests! The REST version will also give you back a lot of fields you don't care about.

Please have a look at the updated portal docs illustrating the difference between REST and GraphQL calls and give the new API a spin.

To see what's possible with the new GeoDB GraphQL API, check out the full schema docs.

Feedback is welcome!

 

View older posts »