pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dimitri Fontaine <dim@tapoueh.org>
To: Brent Wood <Brent.Wood@niwa.co.nz>
To: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: pgloader question - postgis support
Date: Fri, 29 Jun 2018 12:19:01 +0200
Message-ID: <1530267541.372149.1424537048.37E45D96@webmail.messagingengine.com> (raw)
In-Reply-To: <1530239598882.26532@niwa.co.nz>
References: <CANQ55Tsoa6=vk2YkeVUN7qO-2YdqJf_AMVQxqsVTYJm0qqQQuw@mail.gmail.com>
	<CAEepm=0WPQgzt9yNHYJxJKp_qgk-jr-JX4u2395K7So3xGMbhA@mail.gmail.com>
	<1530239598882.26532@niwa.co.nz>

Hi Brent,

Yes I think it's possible, simply playing with the TARGET COLUMNS clause of the pgloader command. Would you mind opening an issue on Github, where I track bug fixes and user requests, so that our conversation is then publicly archived and available to other PostGIS and pgloader users?

Thanks,
-- 
  Dimitri Fontaine
  dim@tapoueh.org

On Fri, Jun 29, 2018, at 04:33, Brent Wood wrote:
> Hi,
> 
> 
> I'm looking at pgloader to automate data loading into a Postgis enabled 
> Postgres database.
> 
> 
> I have seen in the tutorial how the internal point type is supported, 
> and how the postgis extension can be pre-installed by pgloader if 
> necessary, but I can't see how I might take x & y values & save as a 
> postgis point. I guess I could do this via a trigger, but that is 
> hopefully an unnecessary workaround.
> 
> 
> if I read data in (say from CSV):
> 
> 
> 1,tan0104,1,173.567,-43.678
> 
> ...
> 
> 
> to a Postgis table:
> 
> create table station
> 
> (id         int     primary key,
> 
>  trip       char(7)
> 
>  station_no int,
> 
>  lon_s      decimal(7,4),
> 
>  lat_s      decimal(6,4),
> 
>  startp     geometry(POINT,4326));
> 
> 
> 
> the startp column is populated by the SQL:
> 
> startp=ST_SetSRID(ST_MakePoint(lon_s,lat_s),4326)
> 
> 
> This creates a point feature from the x (lon) & y (lat) coordinates,
> 
>   and specifies the coordinate reference system as lat/lon degrees WGS84 
> (EPSG:4326) to match the column specification.
> 
> 
> How can I implement that in the pgloader command to load the CSV file?
> 
> 
> 
> Thanks
> 
> 
> Brent Wood
> 
> Programme leader: Environmental Information Delivery
> NIWA
> DDI:  +64 (4) 3860529
> 
> 
> 
> Brent Wood
> Principal Technician - GIS and Spatial Data Management
> Programme Leader - Environmental Information Delivery
> +64-4-386-0529 | 301 Evans Bay Parade, Greta Point, Wellington | 
> www.niwa.co.nz<http://www.niwa.co.nz;
> [NIWA]<http://www.niwa.co.nz;
> To ensure compliance with legal requirements and to maintain cyber 
> security standards, NIWA's IT systems are subject to ongoing monitoring, 
> activity logging and auditing. This monitoring and auditing service may 
> be provided by third parties. Such third parties can access information 
> transmitted to, processed by and stored on NIWA's IT systems.
> 
> 
> 
> Email had 1 attachment:
> + image9c19a7.JPG
>   28k (image/jpeg)




view thread (2+ messages)

Message-ID: <1530267541.372149.1424537048.37E45D96@webmail.messagingengine.com>
Permalink:  ../1530267541.372149.1424537048.37E45D96@webmail.messagingengine.com/
Also on:    postgresql.org/message-id/1530267541.372149.1424537048.37E45D96@webmail.messagingengine.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: dim@tapoueh.org, Brent.Wood@niwa.co.nz
  Subject: Re: pgloader question - postgis support
  In-Reply-To: <1530267541.372149.1424537048.37E45D96@webmail.messagingengine.com>
  References: <CANQ55Tsoa6=vk2YkeVUN7qO-2YdqJf_AMVQxqsVTYJm0qqQQuw@mail.gmail.com> <CAEepm=0WPQgzt9yNHYJxJKp_qgk-jr-JX4u2395K7So3xGMbhA@mail.gmail.com> <1530239598882.26532@niwa.co.nz> <1530267541.372149.1424537048.37E45D96@webmail.messagingengine.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox