RESTful API added to Geodata Solutions

If you've been wondering why a world of web site developers, CMS teams, shopping cart providers, and blue chips are all maintaining their own independent geographical databases, then you're not alone. 

Imagine if every website wanting to display the weather forecasts, forex information, or sporting results all had to download CSV files from a github repository and then commit themselves to maintaining their own lists forever more. 

Countries, states and cities may not pop into existence as often as the weather changes, but the idea that every website should maintain their own database seems crazy. It's the kind of thing that is ideally suited to a web service.

Updating country lists may be a mere irritation, an occasional chore, for a website administrator. After all, the last time a new country needed to be added was back in 2011, when South Sudan gained independence from Sudan. However, states and their names change much more frequently, and towns and cities even more so. And then there's additional information about locations, such as their population, that change even more frequently.

The point of Geodata Solutions is to make this tedious task a job for one organisation, rather than for millions around the world. I plan to build on the existing database I've created, keep it current, and build on its assets. My hope is that this project will change the way geographical information is sourced in web applications. Syndicated usage of the system will alleviate the duplicated burden of maintaining local data stores, while allowing error reporting and updates to be submitted by millions of users. 

The RESTful interface is in 'Beta' at the moment. It offers country lists, state lists and city lists, along with some basic additional location information. Developers wanting to use the system should get in touch for an API key, as well as requests for new search types or filtering, or new pieces of data. There's also quite a big job in completing gaps in the data set, of which population data is a significant one.

0
0
0
s2sdefault

I'm pleased to announce that version 1.0.1 of the Geodata Solutions Location List Custom Fields Plugin is now completed.

Joomla site owners can now add location data to their content, categories, user and contacts components.

There were some difficulties along the way. Given the newness of the custom fields functionality, there is little documentation for the new plugin type, and the routine for adding new custom field types differs from the custom fields types offered in the default Joomla package, which have their templates hard-baked into the core. I have to thank people on the Joomla forum, who were able to assist with questions and offer support.

This is just the first iteration of the extension, and there are many improvements to come, within the functionality of the plugin's code, and also in the web service offered on the Geodata Solutions side.

A few 'hacks' were required in this version:

  • The jQuery chosen library had to be subverted in order to get the ajax functionality of the lists (as coded in general-use code snippet version) to work within Joomla's back end. The ability to 'destroy' the -chzn elements was available in Joomla 2.5, but it seems this was removed in J3.x. This version of the extension uses a hack that hides the chosen elements and unhides the original form fields offered by cavarief here.
  • The system uses the simple javascript request method that the general use code snippet uses. The disadvantage of this is that it doesn't allow for secure serverside authentication. At current usage, there is no need to throttle access to the web service, but I anticipate that when usage increases, I'll need to switch to a superior solution. Some things to note:
    • Authentication currently checks the HOST header in the js request- it's the crudest way of recording the usage of each separate implementation of the system, but hardly the most reliable
    • Proposed solution in the next release would be to have a key generated with each download of the plugin (I think I can do this without requiring registration with Geodata Solutions- something that I think is a barrier to quick implementation) which the user could simply enter into the plugin configuration
    • Very high volume sites might have to subscribe to support the service at a later stage
  • There are issues related to the output/override of custom fields in the user component. This is reported issue, and one that I hope will be corrected in future Joomla version. Until then users will have to put up with the pipe-separated format used for stage within their user profile views in the front end (eg. Australia|Victoria|Ballarat ) or create their own template override. If you want some help implementing this, or want to share your solution, then please get in touch.

The plugin was submitted to the JED on 4th July, and at time of writing is pending approval, but you can download Location Lists Custom Fields Plugin  and read the (minimal) Location Lists Documentation

0
0
0
s2sdefault

Why would any website administrator or developer want to 'outsource' something as simple as a country list to a web service?

It sounds like a valid question. Implementing these isn't rocket science, and there are a load of sites with detailed instructions on how this can be achieved with a bit of jQuery, HTML, serverside code (whatever flavour) and some mysql data dumps. I began this process recently when needing a set of dynamic country- state (county for some places) - city dropdowns for a site I was working on. Although there's some great code snippets out there being offered graciously (and freely!) by fellow developers, I wondered why we're all re-inventing the wheel.

0
0
0
s2sdefault

Read more: Select lists as a web service?! Really?

Outgrown Joomla?

Most of my clients are companies that started off with a simple Joomla website years ago, either because they arrived at it by evaluating the CMSs strengths against other systems, or because the initial designer they worked with worked with Joomla, and so they ended up with the system by default. Fortunately, these businesses grew, and the requirements they demanded from their Joomla site became more specialised. 

While new businesses often buy commercial extensions that are by nature a one-size-fits-all setup, in a growing business it's less acceptable to have your business systems dictated by your Joomla extensions. So what can businesses who feel like they've outgrown Joomla do?

0
0
0
s2sdefault

Read more: Outgrown Joomla?

Here is an example of the select lists possible with only a few lines of code...

<select name="country" class="countries presel-byip" id="countryId">
    <option value="">Select Country</option>
</select>
<select name="state" class="states" id="stateId">
    <option value="">Select State</option>
</select>
<select name="city" class="cities" id="cityId">
    <option value="">Select City</option>
</select>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> 
<script src="http://geodata.solutions/includes/countrystatecity.js"></script>
Back to Top