# Actual Distance from a Celstial (EVE Math)

So, when we get a Killmail from API, we get the position in XYZ of where it happened. This is wonderful, and it lets us find the nearest celestial and even the distance from it.

However, The points of the celestials (let’s use a stargate for example) are for its center. So if the calculated distance is 400000m (400km) this is not what the actual distance from the stargate is but from the stargate’s center.

So, my question is: how do I find the radius of the stargate/station/etc to subtract this when calculating distance? With certain celestials, we can use mapCelestialStatistics, but in the case of things like gates/stations, I can not seem to find this information in the SDE. If this information cannot be obtained, any way to get a “best estimate”?

Thanks in advance to anyone that may have an idea as to how to handle this.
o7

For stargates you can get this data from ESI.

I do not know which are which/actually used but the list is here:

16 Stargate (Caldari System)
17 Stargate (Amarr Constellation)
3873 Stargate (Caldari Border)
3874 Stargate (Gallente Constellation)
3875 Stargate (Gallente System)
3876 Stargate (Gallente Border)
3877 Stargate (Minmatar Constellation)
17135 Stargate under construction and repair
23963 Stargate Gallente 1
24565 Stargate - Caldari 1
24566 Stargate - Caldari
24685 Stargate Minmatar 1
25231 Stargate - Minmatar
25232 Stargate - Gallente
29624 Stargate (Amarr System)
29625 Stargate (Amarr Border)
29626 Stargate (Amarr Region)
29627 Stargate (Caldari Constellation)
29628 Stargate (Caldari Unused)
29629 Stargate (Caldari Region)
29630 Stargate (Gallente Unused 2)
29631 Stargate (Gallente Unused 1)
29632 Stargate (Gallente Region)
29633 Stargate (Minmatar System)
29634 Stargate (Minmatar Border)
29635 Stargate (Minmatar Region)

Can also do a similar thing for stations, for example for jita https://esi.evetech.net/latest/universe/stations/60000463/ the type_id of the station is https://esi.evetech.net/latest/universe/types/4024/

54 Caldari Logistics Station
56 Gallente Military Station
57 Gallente Station Hub
58 C-O-1
59 C-O-2
1530 Caldari Research Station
1926 Amarr Station Hub
1927 Amarr Station Military
1928 Amarr Industrial Station
1929 Amarr Standard Station
1930 Amarr Mining Station
1931 Amarr Research Station
2071 Station (InterBus)
2496 Minmatar Hub
2497 Minmatar Industrial Station
2498 Minmatar Military Station
2499 Minmatar Mining Station
2500 Minmatar Research Station
2501 Minmatar Station
3865 Gallente Research Station
3867 Gallente Industrial Station
3869 Gallente Logistics Station
3870 Gallente Mining Station
3871 Caldari Station Hub
3872 Caldari Military Station
4023 Caldari Mining Station
4024 Caldari Food Processing Plant Station
9856 Amarr Class A Starport
9857 Amarr Class B Starport
9867 Heaven
9868 Concord Starbase
9873 Dark Amarr Station O
10795 Jovian Construct
12242 Station (Conquerable 1)
12294 Station (Conquerable 2)
12295 Station (Conquerable 3)
19757 Research Outpost
21642 Caldari Research Outpost
21644 Amarr Factory Outpost
21646 Minmatar Service Outpost
22296 Blood Raider Logistics Outpost
22297 Blood Raider Military Outpost
29387 Repaired Amarr Station Hub
29388 Repaired Amarr Military Station
29390 Damaged CONCORD Station
34325 Sisters of EVE Logistics Station
34326 Sisters of EVE Industrial Station

This data is prob in the sde somewhere tho…

1 Like

This data is in the `typeIDs.yml` SDE file. Looks like @Steve_Ronuken missed it in his yamlloader :0. But it is on the type_id. So you would have to figure out the type_id the startgate/station then go from there.

``````29624:
graphicID: 3458
groupID: 10
mass: 100000000000.0
name:
de: Stargate (Amarr System)
en: Stargate (Amarr System)
fr: Portail stellaire (système amarr)
ja: スターゲート（アマーシステム）
ru: Stargate (Amarr System)
zh: 星门（艾玛星系）
portionSize: 1
published: false
raceID: 4
sofFactionName: amarrbase
soundID: 32
volume: 10000000.0
``````
1 Like

Thank you both very much, this definitely will get me on the right track to getting the ACTUAL distance/closest distance etc.

The stations look like they will be easy, as getting the type is pretty simple. With the Stargates, its also just as simple as - https://esi.evetech.net/latest/universe/stargates/{StationID}/

So nice and easy!

Thanks so much again,

Wolf

Np, really just need to iterate on the list i gave and store the radius as they are static values.

1 Like

My thoughts exactly!
I was just about to start making a table to store it and a script to get it =P

1 Like

It was definitely easy to get all of the stations,
The stargates, sadly, do not have their typeID anywhere that I have found yet, so that will take a bit more time.

Here is a list of all the stations though, if anyone is interested:

``````stationTypeID:54 - Radius: 15351

I gave you the list of startgate type_ids already Check my first post.

Or if you looking off the SDE, its where `group_id = 10`

That part I did see,
I meant finding out which type each individual stargate is.

Oh like in a system.

To do that you would have to lookup the system using the systems endpoint. Like:

https://esi.evetech.net/v4/universe/systems/30000142/ then look at the stargates array to get stargate IDs,

https://esi.evetech.net/v1/universe/stargates/50001248/ then would be the `type_id` property

EDIT: Or also maybe try mapDenormalized, and filter down to only type_ids in the lis above.

Thats what was thinking, looking them up in mapDenormalize, then looking up the gate by itemID, sadly the typeID in the table is not the typeID I would use for that API call.

Okay, I see what the problem was… I am assuming that either the dump I got, or the import was wrong… It was listing all the typeID in mapDenormalize as 127, I just downloaded an export of just that table, and it was all the correct ID’s — no wonder I was having such a hard time with all of this.

Again, thank you, I probably would not have been able to to get this far without you.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.