Creating Point Geometries with MakePoint
There are numerous ways of creating point geometries in PostGIS. We have covered these ways in other snippets. Check out the fulling links for other examples.
MakePoint is perhaps in terms of speed the fastest way of creating a PostGIS geometry and on tests I have done, can be as much as 5 to 10 times faster. The downside of MakePoint is that it is not defined in the OGC spec so its not quite as portable across other spatial databases as is GeomFromText and PointFromText.
MakePoint is used in the form MakePoint(x, y) which for pretty much all spatial reference systems means MakePoint(longitude, latitude)
Transformable (Reprojectable) and Non-Transformable Geometries
MakePoint used alone creates a nontransformable geometry (one that has an SRID = -1, so because of that, MakePoint is usually used in conjunction with SetSRID to create a point geometry with spatial reference information. Examples below and the EWKT output to demonstrate the differences.
Example below can not be used in a transformation to transform to another Spatial Reference System
SELECT MakePoint(-71.09405383923, 42.3151215523721) as the_point, AsEWKT(MakePoint(-71.09405383923, 42.3151215523721)) as ewkt_rep
Emparting Spatial Information to MakePoint Geometry
SELECT SETSRID(MakePoint(-71.09405383923, 42.3151215523721),4326) as the_point, AsEWKT(SETSRID(MakePoint(-71.09405383923, 42.3151215523721),4326)) as ewkt_rep