[postgis-users] Intepolation

63 views
Skip to first unread message

Michael Ngugi Kimani

unread,
Jan 15, 2013, 8:29:33 AM1/15/13
to postgi...@lists.osgeo.org
Hi all,
Is is possible to create a query in postgis that does interpolation using point data.

 
 
 
 
Respectfully yours,
 
********************************************
 
Ngugi Kimani M.
P.O. Box 449 - 00520
Ruai, Kenya.
 
********************************************

Sandro Santilli

unread,
Jan 15, 2013, 8:33:06 AM1/15/13
to Michael Ngugi Kimani, PostGIS Users Discussion
On Tue, Jan 15, 2013 at 05:29:33AM -0800, Michael Ngugi Kimani wrote:
> Hi all,
> Is is possible to create a query in postgis that does interpolation using point data.

Yes, see the linear referencing section in the reference manual:
http://postgis.net/docs/manual-2.0/reference.html#Linear_Referencing

--strk;
_______________________________________________
postgis-users mailing list
postgi...@lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users

Jan Hartmann

unread,
Jan 17, 2013, 8:46:08 AM1/17/13
to postgi...@lists.osgeo.org
Can anyone tell me where the nadgrids-file, as used by proj4 to apply grid shifts to a projection, should be installed for postgis? I produced one, put it in the standard proj installation directory (/usr/share/proj), and it works from the commandline with cs2cs. However, when I put an entry in the postgis spatial_ref_sys table for a new projection with this nadgrids file, the st_transform command says: "failed to load datum shift file (-38). It also happens when I put in the whole path. What should I do?

Jan

Jan Hartmann

unread,
Jan 17, 2013, 9:11:21 AM1/17/13
to PostGIS Users Discussion
Or perhaps the place in the source code that generates the error message:

ERROR:  transform: couldn't project point (155000 463000 0): failed to load datum shift file (-38)

I did several greps on the postgis-2.1.0SVN tree, without any result

-------- Original Message --------
Subject: [postgis-users] Location of nadgrid file
Date: Thu, 17 Jan 2013 14:46:08 +0100
From: Jan Hartmann <j.l.h.h...@uva.nl>
Reply-To: PostGIS Users Discussion <postgi...@lists.osgeo.org>
To: <postgi...@lists.osgeo.org>
Attached Message Part

Howard Butler

unread,
Jan 17, 2013, 9:19:53 AM1/17/13
to PostGIS Users Discussion
Setting PROJ_DEBUG=ON in the shell environment before starting postgres might be instructive. 
<Attached Message Part>

Jan Hartmann

unread,
Jan 17, 2013, 9:52:23 AM1/17/13
to PostGIS Users Discussion
That's it. I exported  PROJ_DEBUG=5, and restarted the server. In the log I see a proj error message: "pj_open_lib  <path>/test.ntv2 failed", followed by the PostGIS error message. The location for ntv2-files seems to be:

<postgresql install dir>/share/contrib/postgis-2.1/proj

So I copied the ntv2 file there, restarted the server again, and the whole thing works.

Is this a bug? Even when I give an absolute path for the ntv2-file, it gets appended to the above location. And I would prefer the ntv2 files to be read from the standard proj installation directory. It's given with configure, so that shouldn't be a problem. Or should the postgresql server only have access to its own install dir? In that case, this should be documented.

Anyway, thanks Howard, for the fast reply.

Jan




Mark Cave-Ayland

unread,
Jan 18, 2013, 9:11:03 AM1/18/13
to PostGIS Users Discussion
On 17/01/13 14:52, Jan Hartmann wrote:

> That's it. I exported PROJ_DEBUG=5, and restarted the server. In the log
> I see a proj error message: "pj_open_lib <path>/test.ntv2 failed",
> followed by the PostGIS error message. The location for ntv2-files seems
> to be:
>
> <postgresql install dir>/share/contrib/postgis-2.1/proj
>
> So I copied the ntv2 file there, restarted the server again, and the
> whole thing works.
>
> Is this a bug? Even when I give an absolute path for the ntv2-file, it
> gets appended to the above location. And I would prefer the ntv2 files
> to be read from the standard proj installation directory. It's given
> with configure, so that shouldn't be a problem. Or should the postgresql
> server only have access to its own install dir? In that case, this
> should be documented.
>
> Anyway, thanks Howard, for the fast reply.

Hi Jan,

The reason that the share/contrib path exists was for the Windows
Installer - this allows it to bundle a local copy of the grid files
rather than using a system libproj.dll which may or may not have the
grid files installed.

In general, the in-built libproj.dll search path should work as normal
and use the PostGIS path as a fallback, so it suggests something else is
amiss.


HTH,

Mark.

Jan Hartmann

unread,
Jan 18, 2013, 9:17:03 AM1/18/13
to PostGIS Users Discussion

On 01/18/2013 03:11 PM, Mark Cave-Ayland wrote:
Hi Jan,

The reason that the share/contrib path exists was for the Windows Installer - this allows it to bundle a local copy of the grid files rather than using a system libproj.dll which may or may not have the grid files installed.

In general, the in-built libproj.dll search path should work as normal and use the PostGIS path as a fallback, so it suggests something else is amiss.

In my case (a clean, self-compiled Linux version with user defined installation directories) there seem to be two problems:

- the original proj search-path isn't found
- an absolute path gets appended to the PostGIS path

I'm not sure of the first one, but the second is certainly a bug.

Jan
Reply all
Reply to author
Forward
0 new messages