
Postgres geography type is not limited to Earth - craigkerstiens
http://www.bostongis.com/blog/index.php?/archives/266-geography-type-is-not-limited-to-earth.html
======
mooneater
Giving credit where due -- postGIS depends on Proj4 for coordinate
projections: [http://trac.osgeo.org/proj/](http://trac.osgeo.org/proj/)

~~~
ringshall
Which is why other projects that depend on Proj4, such as QGIS, also work with
projections for various celestial bodies.

------
askvictor
This is awesome. Purely out of interest, how would one go about a similar
location database for arbitrary locations in space? PostGIS presumably assumes
a spheroid planet; what if I'm tracking objects in interplanetary space? Are
there any DB plugins (accessible outside of national space agencies) that can
do that?

~~~
bad_alloc
> what if I'm tracking objects in interplanetary space?

I guess you'd just want to store the orbital information of that object, as it
probably won't stay at a fixed position.

~~~
askvictor
Indeed; does that mean such a database would need to run an n-body simulation
to determine where one object is compared to another at a given time?

~~~
Demiurge
That would require arbitrary telemetry and possibly non-deterministic
solution, or something like
SPICE([https://naif.jpl.nasa.gov/naif/toolkit.html](https://naif.jpl.nasa.gov/naif/toolkit.html))
which is a bit too far outside of 'database' domain.

------
matthewrudy
Spatialreference.org is a great resource for finding these coordinate systems.

For example, in Korea a bunch of mapping providers use "UTM-K", which is some
custom UTM projection

(defined such that coordinate [1_000_000, 2_000_000] is some point in the
mountains in the north of South Korea (38.0, 127.5 lat/lon))

Just search UTM-K on spatialreference, [http://spatialreference.org/ref/sr-
org/7308/](http://spatialreference.org/ref/sr-org/7308/)

And you get the magic postgis incantation [http://spatialreference.org/ref/sr-
org/7308/postgis/](http://spatialreference.org/ref/sr-org/7308/postgis/)

Then just set the srid and everything should work nicely.

------
Antrikshy
You mean PostGIS*, which appears to be an add-on for Postgres.

~~~
ianai
Yes but the ability to have this add on is a deep feature of Postgresql
missing from other RDBMS

~~~
nimchimpsky
its not missing from sql server, or oracle.

~~~
nodesocket
Geo/GIS is an area where SQL Server and Oracle have a solid lead over MySQL
and PostgreSQL. Oracle especially handles GIS data extremely well.

~~~
anc84
Benchmarks and proof on Oracle handling GIS data better than PostGIS please.

~~~
nimchimpsky
sql server does. We benchmarked it at work.

If you are that interested do your own tests.

~~~
anc84
Good for you but I did not ask for stranger's anecdotes. Everything I find
online does not support your point so I cannot take your word for it.

~~~
nimchimpsky
I'm not asking you to take my word for it, I'm suggesting you test it yourself
using your typical use case.

~~~
anc84
And I have neither the time nor the resources to do that comprehensively.

------
adamnemecek
I'm being nitpicky but "geography" means "description of Earth" so if we
aren't talking about Earth it's not geography anymore :-). The word might be
topography?

~~~
falcor84
Ha, I personally always assumed that "earth" in this context refers to
land/soil. Could anyone familiar with the Greek root let me know if that works
in the original?

~~~
Someone
Yes, it does.
[https://en.wiktionary.org/wiki/γῆ#Ancient_Greek](https://en.wiktionary.org/wiki/γῆ#Ancient_Greek):

 _" γῆ • (gê) f (genitive γῆς); first declension

1\. land, earth 2\. country 3.soil"_

~~~
thaumasiotes
You can do better than that for a source.
[http://www.perseus.tufts.edu/hopper/text?doc=Perseus%3Atext%...](http://www.perseus.tufts.edu/hopper/text?doc=Perseus%3Atext%3A1999.04.0058%3Aentry%3Dgh%3D)
:

I. _earth_ opp. to heaven, or _land_ opp. to sea; κατὰ γῆν _on land, by land_

2\. _earth_ , as an element, opp. to air, water, fire

II. _a land, country_ ; γῆν πρὸ γῆς _from land to land_

III. _the earth_ or _ground_ as tilled

IV. _a lump of earth_ , in the phrase γῆν καὶ ὕδωρ αἰτεῖν, γῆν καὶ ὕδωρ
διδόναι, in token of submission

[http://www.perseus.tufts.edu/hopper/text?doc=Perseus%3Atext%...](http://www.perseus.tufts.edu/hopper/text?doc=Perseus%3Atext%3A1999.04.0057%3Aentry%3Dgh%3D)
is a much more detailed, less quotable dictionary entry.

As you can see, the greek word refers equally well to the planet (sense I,
"the earth, including land and sea, in contrast to heaven") and the dirt
(senses 2, III, and IV), just like the english word.

------
brennankreiman
Phil Stooke has an interesting method for modeling small space objects, would
be interesting to apply a non-spherical coordinate system.
[http://publish.uwo.ca/~pjstooke/plancart.htm](http://publish.uwo.ca/~pjstooke/plancart.htm)

------
EGreg
I just stick to using geohash with regular indexes. Luckily it has no patents
around it.

