Hacker News new | past | comments | ask | show | jobs | submit login
Postgres geography type is not limited to Earth (bostongis.com)
154 points by craigkerstiens on Aug 20, 2017 | hide | past | favorite | 35 comments



Giving credit where due -- postGIS depends on Proj4 for coordinate projections: http://trac.osgeo.org/proj/


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


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?


> 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.


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?


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


http://tdc-www.harvard.edu/catalogs/sao.html

Sensibly, the star catalog is arranged by apparent position from Earth. There are two kinds of motion that need to be accounted for: the precession of the earth, which affects all coordinates uniformly ( http://www.stargazing.net/kepler/b1950.html ) and "proper motion" of the stars themselves: https://en.wikipedia.org/wiki/Proper_motion

Proper motion is rather slow. Fortunately astronomy can take measurements across the centuries.

"Proper motion was suspected by early astronomers (according to Macrobius, AD 400) but a proof was not provided until 1718 by Edmund Halley, who noticed that Sirius, Arcturus and Aldebaran were over half a degree away from the positions charted by the ancient Greek astronomer Hipparchus roughly 1850 years earlier."


X, y, z


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/

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

Then just set the srid and everything should work nicely.


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


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


its not missing from sql server, or oracle.


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.


Oracle Spatial isn't that different, compared to PostGIS. Except for license fees, of course.

Meanwhile, they both are missing the concept of spatial contexts.


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


sql server does. We benchmarked it at work.

If you are that interested do your own tests.


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.


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


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


For a person who is relying on benchmarks, you should know that benchmarks are only a rough indication of how well anything performs for a very specific use case.

Your reply is arrogant and ignorant, and you should feel bad about typing that.

> If you are that interested do your own tests.

Why is he not allowed to review your results or check what factors you benchmarked it on? If there's no citation, that claim does not stand.


lol


To be fair, Oracle is usually extremely good at most of the stuff it does. I've no idea about GIS specifically, but, generally, you get what you pay for.


> I've no idea about GIS specifically, but, generally, you get what you pay for.

That's a fascinating/contrary, albeit nebulous thing to say in a thread about Postgres...


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?


TIL Areography!

https://en.wiktionary.org/wiki/areography

> "The scientific study of the planet Mars' geographical features;"

Wait, theres that word again...

Also Topography refers to physical features whereas Geography is much more broad. Funny that there doesn't seem to be a single word for it.


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?


Yes, it does. https://en.wiktionary.org/wiki/γῆ#Ancient_Greek:

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

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


You can do better than that for a source. http://www.perseus.tufts.edu/hopper/text?doc=Perseus%3Atext%... :

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%... 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.


So it only breaks down on gas giants ;-)


I'm guessing it's Earth not earth since there's areography, I.e. "Geography of Mars".


That's just someone being cute in a space where it's relatively convenient. You're not going to find people discussing "aphroditography" for Venus.


And "geometry" means "measurement of earth" so maybe we should call it topometry? :-) (https://en.wiktionary.org/wiki/topometry)


We also do geometry on space and on things that do not and cannot exist in reality. Maybe it should be unimetry :)


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


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




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: