[wp-hackers] Geodata storage

Michael D Adams mda at blogwaffe.com
Fri Jun 4 21:45:04 UTC 2010

I'd like to see all WP geo data stored the same way and in the same
place.  That way geodata stored by one plugin can be used by another,
by the WordPress mobile apps currently out in the wild, or any new
thing that comes out in the future.

I've put up a Codex page with the schema the WordPress mobile apps
use: http://codex.wordpress.org/Geodata

Here's the meat of it:

geo_latitude: REQUIRED
 (float) decimal degrees -90 to 90 (negative
 values are in the southern hemisphere).

geo_longitude: REQUIRED
 (float) decimal degrees -180 to 180 (negative
 values are in the western hemisphere).

geo_public: OPTIONAL (if missing, assume public)
 (int) is the geodata public (1) or private (0).

geo_address: OPTIONAL
 (string) freeform textual description of coordinates.
 "221B Baker St, Westminster, London NW1 6XE, UK",
 "Pasadena, CA", "Soho, NYC", "Idaho", etc.
 Accuracy level and language is arbitrary.

Current implementors of this spec:
http://iphone.wordpress.org/ :

Advantages of the above meta_key names:

1. Lack of underscore prefix means the data is editable without a plugin.

My hypothesis is that people who don't like custom fields clutter
leave that meta_box off anyway.

2. Short and sweet.

3. Implemented and proven.

If anyone has developed or is developing a geo plugin for WordPress
and is using a different storage schema, I'd be happy to help with
whatever compatibility code the plugin needs.

If other keys ar needed (geo_accuracy: int or float: meters?), we can
figure them out and add them.


More information about the wp-hackers mailing list