MCPcopy Create free account
hub / github.com/comaps/comaps / ValidateAndFormat_wikimedia_commons

Method ValidateAndFormat_wikimedia_commons

generator/osm2meta.cpp:332–345  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

330}
331
332std::string MetadataTagProcessorImpl::ValidateAndFormat_wikimedia_commons(std::string v)
333{
334 // Putting the full wikimedia url to this tag is incorrect according to:
335 // https://wiki.openstreetmap.org/wiki/Key:wikimedia_commons
336 // But it happens often enough that we should guard against it.
337 strings::ReplaceFirst(v, "https://commons.wikimedia.org/wiki/", "");
338 strings::ReplaceFirst(v, "https://commons.m.wikimedia.org/wiki/", "");
339
340 if (v.starts_with("File:") || v.starts_with("Category:"))
341 return v;
342
343 LOG(LDEBUG, ("Invalid Wikimedia Commons tag value:", v));
344 return {};
345}
346
347std::string MetadataTagProcessorImpl::ValidateAndFormat_panoramax(std::string v)
348{

Callers

nothing calls this directly

Calls 1

ReplaceFirstFunction · 0.85

Tested by

no test coverage detected