Keep the original and its source
A result appearing on a map does not establish a store location. Several businesses can share a building, and floor or unit details may matter to the visitor. Keep the original address and create a separate search field.
This is a review procedure with independent teaching examples. It does not claim that BAKUO has corrected every address to an entrance or achieved a particular positional error. Record the source file, publisher, reference date, and conversion method so a result can be reviewed later.
Make small, reviewable changes
Start by normalizing Unicode and repeated whitespace, then compare changed rows with the source. Removing parentheses or floor labels everywhere may erase distinctions between a building and its stores. For failed searches, make a candidate address separately and record why it differs.
The prepareAddress function below only cleans whitespace; it does not verify an address. Do not rely on regular expressions alone to update administrative names or convert parcel addresses. Compare with an official address result.
Separate geocoding from transformation
Geocoding finds coordinate candidates for an address. A CRS transformation changes how an existing coordinate is expressed. Guessing EPSG:5179 or EPSG:5186 from the size of the numbers can produce a plausible but incorrect point.
The Kakao address-search documentation describes request conditions and returned address fields; real use needs your own authorization and review of its terms. The PROJ cs2cs documentation explains source CRS and axis order. Keep a row with unknown CRS for review rather than guessing a conversion.
Fix coordinate order in code
Run this complete block in a browser console or Node.js. It does not call an API or transform a CRS. It adapts a verified GeoJSON Point from longitude-first order to named fields. The numeric coordinates are synthetic format examples, not a store location.
function prepareAddress(raw) {
if (typeof raw !== 'string' || raw.trim() === '') {
throw new TypeError('Address must be a non-empty string');
}
return {
rawAddress: raw,
queryAddress: raw.normalize('NFC').replace(/\s+/gu, ' ').trim()
};
}
function geoJsonPointToLatLng(point) {
if (!point || point.type !== 'Point' || !Array.isArray(point.coordinates)) {
throw new TypeError('Expected a GeoJSON Point');
}
const [lng, lat] = point.coordinates;
if (!Number.isFinite(lat) || !Number.isFinite(lng)) {
throw new TypeError('Coordinates must be numbers');
}
if (Math.abs(lat) > 90 || Math.abs(lng) > 180) {
throw new RangeError('Coordinates outside latitude/longitude range');
}
return { lat, lng };
}
console.log(prepareAddress(' Example\tBuilding 2F ').queryAddress);
// Example Building 2F
console.log(geoJsonPointToLatLng({ type: 'Point', coordinates: [127, 37] }));
// { lat: 37, lng: 127 }The address output has single spaces and retains “2F.” The point produces lat: 37, lng: 127. That follows GeoJSON coordinate order; it is not an EPSG transformation. Empty addresses and string coordinates produce errors.
Check the pin before publication
- Compare the returned building, road, and administrative area with the original.
- Check the broad geographic range and the actual building separately.
- Keep detailed addresses for underground malls and shared buildings; a pin alone cannot identify an entrance or floor.
- Leave an unmatched address without coordinates rather than substituting a city centre.
A useful completion criterion is being able to explain the connection between the source address and the resulting point. Preserve source and review dates so an address correction or relocation can trigger another check.