2

I'm new to databases.

How can I use the PostGIS Geohash function to run through a column of coordinates and dump results in new column?

Here is the postgis documentation on it

Here's what my data looks like:

enter image description here

  • I know you're new. But even if you're new pictures are not acceptable for textual grids. This should stop now. As you become more familiar with databases, we ask that you provide the DDL to create your table and the DML to insert your data.. or a CREATE TABLE AS SELECT – Evan Carroll Jan 19 '17 at 20:21
  • 1
    Thanks for the rundown on the etiquette. I'll be sure to follow it next time. – edgrmdna Jan 20 '17 at 20:09
6

Since you don't share what you're trying to do, it's hard to know if the answer will be of any use to you.

WITH coords AS (
  SELECT string_to_array(coord, ',') AS coords FROM mytable
)
SELECT ST_GeoHash(ST_SetSRID(ST_MakePoint(coords[1], coords[2]), 4326))
FROM coords;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.