I know Geography(4326)
is an unbounded, and unprojected, and covers the entire world with ellipsoidal coordinates. I get that the math on this system is done on a spheroid. I also get that with a geometry
the math is done on a Cartesian grid. What I really would like to understand is how SRS 4326 can be subject to both ellipsoidal calculations, and Cartesian calculations without reprojection (like ST_Transform
)?
SELECT ST_Distance( ST_MakePoint(0,0)::geography, ST_MakePoint(1,1)::geography );
st_distance
-----------------
156899.56829134
(1 row)
-- same result as ST_MakePoint(x,y)::geography::geometry
-- same result as ST_SetSRID( ST_MakePoint(x,y)::geometry, 4326 )
-- same result as ST_SetSRID( ST_MakePoint(x,y), 4326 )
SELECT ST_Distance( ST_MakePoint(0,0)::geometry, ST_MakePoint(1,1)::geometry );
st_distance
-----------------
1.4142135623731
(1 row)
By extension, MySQL does not support nearly the amount of Geographic operations as PostGIS. Worse, it determines the type of calculation (geometric vs geographic) based not the type (as with PostGIS's geometry
vs geography
) but based merely as the SRS ID marker. For any operations that do not support a geodetic reference system, you have to use a Cartesian reference system (which is obviously major suck because MySQL can't reproject). But why if it has these two shortcomings (fewer geodetic calculations), and an inability to reproject can it not do a geometric calculation (Cartesian reference system) with SRS ID 4326? Lastly, is there any SRS ID that is not geodetic that behaves like PostgreSQL geometry
type in SRS ID 4326, so I can use it with MySQL?
GEOGRAPHY
type in PostGIS to be 'only' a container for the implied ellipsoidal math; it is no projection and its use not limited to a single geodetic datum (e.g. WGS84 - EPSG:4326). if a geographic CRS is used in a cartesian context, its units (degree of Lon/Lat) are projected as if they were planar units, with parallels of constant distance, leaving this 'projection' (Equirectangular - Plate Carée) heavily distorted and useless for anything analytical (neither conformal nor equal area). – geozelot Jan 18 '19 at 9:23One restriction is that it only supports WGS 84 long lat (SRID:4326).
because4326
is a code of the EPSG database, and EPSG:4326 is lat lon. – nmtoken Jan 18 '19 at 11:01