[postgis-users] Looking for documentation on measures

strk at refractions.net strk at refractions.net
Tue Oct 4 00:55:10 PDT 2005


Chris, some No-Nos from a quick read and a build test:

	- addLastPoint is declared to return LWLINE, but
	  pglwgeom_serialize() used in return produces a PG_LWGEOM intead

	- on line 878 and 881 you assign a PGLWGEOM to an LWGEOM

	- on line 943 you don't use Postgresql macros for the return

	- <interrupted>

Some generic things:

	- Some warnings are due to non-correct const usage in lwgeom lib
	  (like lwgeom_getnumgeometries not taking a const arg)

	- all LW* objects can be upcast to LWGEOM, if you make all LW* returning
	  functions actually return LWGEOM there'll be no need to use cast
	  on return type (see first two compiler warnings)

	- it is often preferrable to work on deserialized geoms rather then
	  serialized ones, mainly for reuse but sometimes for speed as well

	- make_lwpoint2d() returns allocated memory, should be manually freed

--strk;


On Mon, Oct 03, 2005 at 11:44:29PM -0400, Christoph Spoerri wrote:
> Hi there,
> 
> attached is code for some LRS functions that I implemented in my spare time. 
> The cover the basics and include:
> 
> - create M values based on line length or the percentage along line
> - return a measure for a given point (point doesn't need to be on LRS/line)
> - return point given a measure
> - return a line given two measure (start and end)
> 
> Other functions I was think of implementing:
> - create M values based on user input (start and end M)
> - create M values based on user input (array of M values)
> - return line given measure values and an offset value; this one would 
> calculate a new line and offset from the original
> - recalculate M values based on ???
> - others ???
> 
> the attached code has a couple more explanation in the header.
> 
> In case somebody is new the LRS or is wondering how I implemented the LRS with 
> the M value of the postgis LWGEOM, please take a look at 
> http://www.gisgeek.com/lrs/. Bill Wheaton was so nice and started a tutorial 
> for LRS with some examples.
> 
> Note: I'm not an expert C coder, therefore the code still throws some compile 
> errors. Yet, so far they didn't lead to any crashes :) Also, if a C expert 
> sees some big No-No, please let me know.
> 
> Enjoy and let me know what you think or find. If you like what you see and 
> would like any additional enhancements, feel free to drop me a note. I would 
> love to add some more functionality.
> 
> cheers,
> Christoph
> 
> 
> On Monday 03 October 2005 15:19, Chris Matheson wrote:
> > Hello Everyone,
> >
> > I am new to PostGIS, and I am looking for documentation related to
> > "measures" and "linear referencing" (particularly interested in
> > functions).  Hopefuly documentation exists, if so would someone please
> > be kind enough to send me a reference.
> >
> > Chris M.
> > _______________________________________________
> > postgis-users mailing list
> > postgis-users at postgis.refractions.net
> > http://postgis.refractions.net/mailman/listinfo/postgis-users


> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users




More information about the postgis-users mailing list