Can you cast? No.
geography are PostGIS types, and your types are likely
double, or something like that.
Can you create PostGIS types? Yes.
What you want to do is use
ST_MakePoint(pickup_longitude, pickup_latitude) as pickup_pt,
ST_MakePoint(dropoff_longitude, dropoff_latitude) as dropoff_pt
If you don't have PostGIS.
- Get it. Install it. Use it:
CREATE EXTENSION postgis;
Or, if you can't get or have a good reason for not wanting it, then and only then should you even consider using the native type,
point(pickup_longitude, pickup_latitude) as pickup_pt,
point(dropoff_longitude, dropoff_latitude) as dropoff_pt
Geometery vs Geography
Geography to geometry conversions are a function to PostGIS. But you can do it with
Or, you can use another geometery srid with
SELECT ST_SetSRID( ST_MakePoint(long,lat), srid );