Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fYqUg-0006qe-2p for pgsql-general@arkaria.postgresql.org; Fri, 29 Jun 2018 10:19:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fYqUe-0006kI-63 for pgsql-general@arkaria.postgresql.org; Fri, 29 Jun 2018 10:19:08 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fYqUd-0006jz-2b for pgsql-general@lists.postgresql.org; Fri, 29 Jun 2018 10:19:07 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fYqUZ-0008Mu-Cb for pgsql-general@lists.postgresql.org; Fri, 29 Jun 2018 10:19:05 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 688E721AC4; Fri, 29 Jun 2018 06:19:02 -0400 (EDT) Received: from web3 ([10.202.2.213]) by compute4.internal (MEProxy); Fri, 29 Jun 2018 06:19:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tapoueh.org; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=8cMNKoMbFTFYO5aZYlvKiwW4jR JO7o835H7HCRX9q6M=; b=UfJKE01L8/eJ7D0b8LydVsn9x6397dcBzD35CFzwQD 0OOqvLkBFSFZt8fxTjniNhxbUvTRcQSugqQuUG1PyEo0kIPOnYUz5RVNEWaKQkRe 6rbGnIMcAxKqUHHCquZ+hxNwqh00KVJ4yLncwNc7LRv3m/G28dX3roem/MEgminX o= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=8cMNKo MbFTFYO5aZYlvKiwW4jRJO7o835H7HCRX9q6M=; b=JantM1DFii0I/TD9CNa47z E73U2huedkKgj2fa1RZdtLRalakPbloqLZeY9tbCQE0N/PhXLsgQJalOK7s3aiq6 F9YyHj+kzbdh6wgFYGqbKMOUEkJ0L9GEhXlvVW4K7T2jQs+Ui5k2jMN6G6IpMkcp 2ZaE6H+pHAYcUSKTexgXJ34uw8F4s4UKXmSfFim1CQHuwKc69duYrE1I1wigT/rB ckj8KNXD3HPL0DI59o+0ctWKMeOUgFGD8SUxscbo9eFC6L3NUDCQKC95pm7YW9hx aaxSnKrAgBoulBYV/IlOUfTRHVqgUbbyITaKKBZPV5lD6Mb9dZo5g82VF6dHwi/g == X-ME-Proxy: X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id EAEB69E498; Fri, 29 Jun 2018 06:19:01 -0400 (EDT) Message-Id: <1530267541.372149.1424537048.37E45D96@webmail.messagingengine.com> From: Dimitri Fontaine To: Brent Wood , "pgsql-generallists.postgresql.org" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-0d8ea36c References: <1530239598882.26532@niwa.co.nz> In-Reply-To: <1530239598882.26532@niwa.co.nz> Date: Fri, 29 Jun 2018 12:19:01 +0200 Subject: Re: pgloader question - postgis support List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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 > [NIWA] > 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)