Where can I find the locations of all or many of the factories in the world, including in Japan and the United States?
In the United States, you might start by looking at water permits. Most large factories have to get permits for their waste and storm water runoff.
Here are discharge permits for Illinois. http://dataservices.epa.illinois.gov/dmrdata/dmrsearch.aspx
Storm water permits: Many industrial facilities have to get a permit for the pollution caused by water running off a location. Here's data for Illinois
Datamyne is a great source for finding sourcing of suppliers(factories) based on commodity descriptions OR via a product HS code. We source our US data via US Customs and posses trade data from 50 other countries globally. We are also a certified silver partner with ESRI and currently possess a map with over 600,000 companies geocoded along with Duns and Bradstreet verifiable information. http://www.datamyne.com/our-product/