[ckan-dev] CKAN HTSQL-api and PostGIS queries.

Adrià Mercader adria.mercader at okfn.org
Mon Oct 28 10:54:39 UTC 2013


Hi Henrik,

I don't think that the datastore includes support for PostGIS
geospatial fields but perhaps if you set up the tables manually you
can indeed exectue postgis commands via the SQL api.

To enable a table with PostGIS you need:
1. Enable PostGIS on the database, with the two commands you posted
2. Add a PostGIS geometry column to your table, which will be the one
you will perform the spatial operations against (eg with
AddGeometryColumn)

As I said, the datastore won't do any of those for you, but you can
investigate doing them manually on the DB.

Here is a really nice introduction to PostGIS by Boundless:

http://workshops.boundlessgeo.com/postgis-intro/


Adrià

On 28 October 2013 08:52, Henrik Aagaard Sørensen <BU1G at tmf.kk.dk> wrote:
> I’m wondering if it is enough, and the correct way, to just run:
>
> sudo -u postgres psql -d datastore_default -f
> /usr/share/postgresql/9.1/contrib/postgis-1.5/postgis.sql
>
> sudo -u postgres psql -d datastore_default -f
> /usr/share/postgresql/9.1/contrib/postgis-1.5/spatial_ref_sys.sql
>
>
>
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev
>




More information about the ckan-dev mailing list