OpenStreetMap, the open-source equivalent to Google Maps, lets you extract places and businesses through an API. You can then batch-import them into GeoDirectory. Here’s the method that worked for me on this website.

Use Overpass turbo to extract data from OpenStreetMap

Overpass Turbo is a web-based data mining tool for OpenStreetMap. It runs any kind of Overpass API query and displays the results on an interactive map. Here’s the query I used:

area["name"="Roma"]->.boundaryarea;
(
nwr(area.boundaryarea)[amenity=drinking_water];
);
out meta;

You can find a list of all OSM locations in the Wiki, but when using Overpass the location names must be entered in the native language, which can get tricky in some parts of the world. Otherwise, here’s the reference list of all OSM data available for export. When you’re ready, extract that data in JSON format.

Import the JSON file to GeoDirectory with WP All Import

Install the WP All Import WordPress plugin and its corresponding GeoDirectory add-on that supports the JSON file format. During the import process, you can map the place names, coordinates, and any custom fields you’ve extracted from OSM to enrich or complement your listings.

Reverse geocoding

The only issue is that you’ll be missing address fields. I found a solution for that. Since the JSON is now imported into the WordPress database, you can export all places into a CSV file from the GeoDirectory settings this time.

Geoapify is an online geocoding tool that batch-generates addresses from coordinates. It uses the OpenStreetMap API, which works fine if you stick with OSM in GeoDirectory’s settings.

But if you choose to display Google Maps within GeoDirectory, as I do, you’ll run into a mismatch: the OSM API often names regions and neighborhoods differently from Google Maps. I had to manually edit my CSV, double-checking how Google Maps names each region, and ensure everything matched the location pages auto-generated by GeoDirectory. Even then, Google isn’t always consistent with how it names regions and cities, so moderation will stay necessary in the future. Your CSV file also shows all custom fields created by your GeoDirectory setup, so this is the right time to batch-edit content for your listings.

Import the CSV file to GeoDirectory

WP All Import is a very versatile plugin, and fortunately, it also supports CSV file import. Follow the same import process, mapping all fields with GeoDirectory.

Leave a Comment