Postgres geography type is not limited to Earth

(bostongis.com)

154 points | by craigkerstiens 2438 days ago

8 comments

  • mooneater 2437 days ago
    Giving credit where due -- postGIS depends on Proj4 for coordinate projections: http://trac.osgeo.org/proj/
    • ringshall 2437 days ago
      Which is why other projects that depend on Proj4, such as QGIS, also work with projections for various celestial bodies.
  • askvictor 2437 days ago
    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 2437 days ago
      > 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 2437 days ago
        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?
    • pjc50 2437 days ago
      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."

    • b34r 2437 days ago
      X, y, z
  • matthewrudy 2437 days ago
    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.

  • Antrikshy 2437 days ago
    You mean PostGIS*, which appears to be an add-on for Postgres.
    • ianai 2437 days ago
      Yes but the ability to have this add on is a deep feature of Postgresql missing from other RDBMS
      • nimchimpsky 2437 days ago
        its not missing from sql server, or oracle.
        • nodesocket 2437 days ago
          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.
          • vetinari 2437 days ago
            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.

          • anc84 2437 days ago
            Benchmarks and proof on Oracle handling GIS data better than PostGIS please.
            • nimchimpsky 2437 days ago
              sql server does. We benchmarked it at work.

              If you are that interested do your own tests.

              • anc84 2437 days ago
                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 2436 days ago
                  I'm not asking you to take my word for it, I'm suggesting you test it yourself using your typical use case.
                  • anc84 2436 days ago
                    And I have neither the time nor the resources to do that comprehensively.
              • haskal 2437 days ago
                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.

            • chillydawg 2437 days ago
              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.
              • sangnoir 2437 days ago
                > 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...

  • adamnemecek 2437 days ago
    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?
    • polemic 2437 days ago
      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.

    • falcor84 2437 days ago
      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 2437 days ago
        Yes, it does. https://en.wiktionary.org/wiki/γῆ#Ancient_Greek:

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

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

        • thaumasiotes 2437 days ago
          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.

        • ygra 2437 days ago
          So it only breaks down on gas giants ;-)
      • adamnemecek 2437 days ago
        I'm guessing it's Earth not earth since there's areography, I.e. "Geography of Mars".
        • thaumasiotes 2437 days ago
          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.
    • Someone 2437 days ago
      And "geometry" means "measurement of earth" so maybe we should call it topometry? :-) (https://en.wiktionary.org/wiki/topometry)
      • Asooka 2437 days ago
        We also do geometry on space and on things that do not and cannot exist in reality. Maybe it should be unimetry :)
  • brennankreiman 2437 days ago
    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
  • EGreg 2437 days ago
    I just stick to using geohash with regular indexes. Luckily it has no patents around it.
  • koitune_sg3y35u 2437 days ago
    annabelle creation full movie online free https://www.linkedin.com/feed/update/urn:li:activity:6305208...