Get the ores and ices in a system

One question was always bugging me: how to get the ores and ices in a system. The current approach by many others was to use the securityClass value of the mapSolarSystems table and combine it with manually generated data.

In the forums (the old archived ones) I found a thread were the securityClass was mapped to a list of available ores: list of ores and a list of ices.

In the EVE-ID wiki I found user generated tables for minerals per solar system and ices by region and security status.

None of the above was a satisfying solution, so I went back into the data dump. Then I started to look at the eveItems table. A table with more than 6 million entries must be good for something. After some testing the query was done:

SELECT 
	items.locationID AS systemID, 
	sys.solarSystemName AS systemName, 
	items.typeID AS oreID , 
	types.typeName AS oreName, 
	IF (types.groupID = 465, 'ice', 'ore') AS beltType
FROM  
	invItems AS items
INNER JOIN mapSolarSystems AS sys 
	ON items.locationID = sys.solarSystemID
INNER JOIN invTypes AS types 
	ON items.typeID = types.typeID
INNER JOIN invGroups AS grps 
	ON types.groupID = grps.groupID
WHERE 
	grps.categoryID = 25
GROUP BY 
	items.typeID, items.locationID
ORDER BY 
	items.locationID

This creates a list of ores and ices per solar system. Extending the where clause allows you to limit the result to certain types or regions.
Example:

-- All belts and ice fields in the metropolis region
AND sys.regionID = 10000042
-- Show all systems with Glacial Mass
AND items.typeID = 16263

Have fun with it.

This entry was posted in Static Data Dump and tagged , , . Bookmark the permalink.

2 Responses to Get the ores and ices in a system

  1. Zifrian says:

    This worked for Incarna but no longer works for Cruicible datadump. Grrr…
    I’ll post work around once I figure it out.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" cssfile="">