# Actual Distance from a Celstial (EVE Math)

**URL:** <https://forums.eveonline.com/t/actual-distance-from-a-celstial-eve-math/108159>\
**Category:** Third Party Developers\
**Created:** [September 21, 2018, 5:58pm UTC](https://forums.eveonline.com/t/actual-distance-from-a-celstial-eve-math/108159 "2018-09-21T17:58:57Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wolf\_Merrik](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/wolf_merrik/32/96305_2.png) [@Wolf\_Merrik](https://forums.eveonline.com/u/Wolf_Merrik)\
**Post date:** [September 21, 2018, 5:58pm UTC](https://forums.eveonline.com/t/actual-distance-from-a-celstial-eve-math/108159/1 "2018-09-21T17:58:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Blacksmoke16](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/blacksmoke16/32/376589_2.png) [@Blacksmoke16](https://forums.eveonline.com/u/Blacksmoke16)\
**Post date:** [September 21, 2018, 6:12pm UTC](https://forums.eveonline.com/t/actual-distance-from-a-celstial-eve-math/108159/2 "2018-09-21T18:12:36Z")

</div>

For stargates you can get this data from ESI.

For example:  
[https://esi.evetech.net/latest/universe/types/29624/](https://esi.evetech.net/latest/universe/types/29624/)

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/](https://esi.evetech.net/latest/universe/stations/60000463/) the type\_id of the station is [https://esi.evetech.net/latest/universe/types/4024/](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  
> 1529 Caldari Administrative Station  
> 1530 Caldari Research Station  
> 1531 Caldari Trading 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  
> 1932 Amarr Trade Post  
> 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  
> 2502 Minmatar Trade Post  
> 3864 Amarr Citadel  
> 3865 Gallente Research Station  
> 3866 Gallente Trading Hub  
> 3867 Gallente Industrial Station  
> 3868 Gallente Administrative 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  
> 21645 Gallente Administrative Outpost  
> 21646 Minmatar Service Outpost  
> 22296 Blood Raider Logistics Outpost  
> 22297 Blood Raider Military Outpost  
> 22298 Blood Raider Trading Outpost  
> 29323 Ishukone Corporation Headquarters  
> 29387 Repaired Amarr Station Hub  
> 29388 Repaired Amarr Military Station  
> 29389 Repaired Amarr Trading Post  
> 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…

---

<div class="post-metadata">

**Author:** ![Blacksmoke16](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/blacksmoke16/32/376589_2.png) [@Blacksmoke16](https://forums.eveonline.com/u/Blacksmoke16)\
**Post date:** [September 21, 2018, 6:26pm UTC](https://forums.eveonline.com/t/actual-distance-from-a-celstial-eve-math/108159/3 "2018-09-21T18:26:21Z")

</div>

This data is in the `typeIDs.yml` SDE file. Looks like @Steve_Ronuken [missed it](https://github.com/fuzzysteve/yamlloader/blob/master/tableloader/tables.py#L623) 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.

```auto
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
    radius: 2473.0
    sofFactionName: amarrbase
    soundID: 32
    volume: 10000000.0

```

---

<div class="post-metadata">

**Author:** ![Wolf\_Merrik](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/wolf_merrik/32/96305_2.png) [@Wolf\_Merrik](https://forums.eveonline.com/u/Wolf_Merrik)\
**Post date:** [September 22, 2018, 2:03am UTC](https://forums.eveonline.com/t/actual-distance-from-a-celstial-eve-math/108159/4 "2018-09-22T02:03:19Z")

</div>

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}/](https://esi.evetech.net/latest/universe/stargates/%7BStationID%7D/)

So nice and easy!

Thanks so much again,

Wolf

---

<div class="post-metadata">

**Author:** ![Blacksmoke16](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/blacksmoke16/32/376589_2.png) [@Blacksmoke16](https://forums.eveonline.com/u/Blacksmoke16)\
**Post date:** [September 22, 2018, 2:04am UTC](https://forums.eveonline.com/t/actual-distance-from-a-celstial-eve-math/108159/5 "2018-09-22T02:04:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Wolf\_Merrik](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/wolf_merrik/32/96305_2.png) [@Wolf\_Merrik](https://forums.eveonline.com/u/Wolf_Merrik)\
**Post date:** [September 22, 2018, 2:12am UTC](https://forums.eveonline.com/t/actual-distance-from-a-celstial-eve-math/108159/6 "2018-09-22T02:12:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Wolf\_Merrik](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/wolf_merrik/32/96305_2.png) [@Wolf\_Merrik](https://forums.eveonline.com/u/Wolf_Merrik)\
**Post date:** [September 22, 2018, 2:40am UTC](https://forums.eveonline.com/t/actual-distance-from-a-celstial-eve-math/108159/7 "2018-09-22T02:40:22Z")

</div>

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
stationTypeID:56 - Radius: 23836
stationTypeID:57 - Radius: 27072
stationTypeID:1529 - Radius: 45734
stationTypeID:1530 - Radius: 26782
stationTypeID:1531 - Radius: 33413
stationTypeID:1926 - Radius: 42489
stationTypeID:1927 - Radius: 48492
stationTypeID:1928 - Radius: 24276
stationTypeID:1929 - Radius: 20081
stationTypeID:1930 - Radius: 22283
stationTypeID:1931 - Radius: 29162
stationTypeID:1932 - Radius: 13887
stationTypeID:2496 - Radius: 33811
stationTypeID:2497 - Radius: 27681
stationTypeID:2498 - Radius: 36902
stationTypeID:2499 - Radius: 30592
stationTypeID:2500 - Radius: 33481
stationTypeID:2501 - Radius: 19714
stationTypeID:2502 - Radius: 15733
stationTypeID:3865 - Radius: 45151
stationTypeID:3866 - Radius: 24871
stationTypeID:3867 - Radius: 29746
stationTypeID:3868 - Radius: 17876
stationTypeID:3869 - Radius: 37560
stationTypeID:3870 - Radius: 28083
stationTypeID:3871 - Radius: 24657
stationTypeID:3872 - Radius: 47854
stationTypeID:4023 - Radius: 47854
stationTypeID:4024 - Radius: 55741
stationTypeID:9868 - Radius: 60432
stationTypeID:10795 - Radius: 47270
stationTypeID:29323 - Radius: 52868
stationTypeID:29387 - Radius: 42489
stationTypeID:29388 - Radius: 48532
stationTypeID:29389 - Radius: 13887
stationTypeID:34325 - Radius: 37560
stationTypeID:34326 - Radius: 29746
```

---

<div class="post-metadata">

**Author:** ![Blacksmoke16](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/blacksmoke16/32/376589_2.png) [@Blacksmoke16](https://forums.eveonline.com/u/Blacksmoke16)\
**Post date:** [September 22, 2018, 2:45am UTC](https://forums.eveonline.com/t/actual-distance-from-a-celstial-eve-math/108159/8 "2018-09-22T02:45:16Z")

</div>

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`

---

<div class="post-metadata">

**Author:** ![Wolf\_Merrik](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/wolf_merrik/32/96305_2.png) [@Wolf\_Merrik](https://forums.eveonline.com/u/Wolf_Merrik)\
**Post date:** [September 22, 2018, 3:46am UTC](https://forums.eveonline.com/t/actual-distance-from-a-celstial-eve-math/108159/9 "2018-09-22T03:46:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Blacksmoke16](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/blacksmoke16/32/376589_2.png) [@Blacksmoke16](https://forums.eveonline.com/u/Blacksmoke16)\
**Post date:** [September 22, 2018, 3:49am UTC](https://forums.eveonline.com/t/actual-distance-from-a-celstial-eve-math/108159/10 "2018-09-22T03:49:10Z")

</div>

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/](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/](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.

---

<div class="post-metadata">

**Author:** ![Wolf\_Merrik](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/wolf_merrik/32/96305_2.png) [@Wolf\_Merrik](https://forums.eveonline.com/u/Wolf_Merrik)\
**Post date:** [September 22, 2018, 4:20am UTC](https://forums.eveonline.com/t/actual-distance-from-a-celstial-eve-math/108159/11 "2018-09-22T04:20:23Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Wolf\_Merrik](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/wolf_merrik/32/96305_2.png) [@Wolf\_Merrik](https://forums.eveonline.com/u/Wolf_Merrik)\
**Post date:** [September 22, 2018, 12:37pm UTC](https://forums.eveonline.com/t/actual-distance-from-a-celstial-eve-math/108159/12 "2018-09-22T12:37:08Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/eveonline/original/3X/4/1/41ec4921cbaca7a6f9ea556e7cc20018461eae5e.png) [@system](https://forums.eveonline.com/u/system)\
**Post date:** [December 21, 2018, 12:37pm UTC](https://forums.eveonline.com/t/actual-distance-from-a-celstial-eve-math/108159/13 "2018-12-21T12:37:10Z")

</div>

Closed on December 21, 2018, 12:37pm UTC

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