[Gvsig_desarrolladores] Como conocer un punto a una determinada distancia

Francisco José Peñarrubia fpenarru en gmail.com
Mie Jul 18 09:22:26 CEST 2007


Estas funciones de PostGIS también te pueden ser útiles:


      6.2.7. Linear Referencing

line_interpolate_point(linestring, location)

    Returns a point interpolated along a line. First argument must be a
    LINESTRING. Second argument is a float8 between 0 and 1 representing
    fraction of total 2d length <cid:part1.02090005.05070701 en gmail.com>
    the point has to be located.

    See line_locate_point() <cid:part2.06060205.02040601 en gmail.com> for
    computing the line location nearest to a Point.


          Note

    Since release 1.1.1 this function also interpolates M and Z values
    (when present), while prior releases set them to 0.0.

    Availability: 0.8.2

line_substring(linestring, start, end)

    Return a linestring being a substring of the input one starting and
    ending at the given fractions of total 2d length. Second and third
    arguments are float8 values between 0 and 1.

    If 'start' and 'end' have the same value this is equivalent to
    line_interpolate_point() <cid:part3.04040903.00000406 en gmail.com>.

    See line_locate_point() <cid:part2.06060205.02040601 en gmail.com> for
    computing the line location nearest to a Point.


          Note

    Since release 1.1.1 this function also interpolates M and Z values
    (when present), while prior releases set them to unspecified values.

    Availability: 1.1.0

line_locate_point(LineString, Point)

    Returns a float between 0 and 1 representing the location of the
    closest point on LineString to the given Point, as a fraction of
    total 2d line <cid:part1.02090005.05070701 en gmail.com> length.

    You can use the returned location to extract a Point
    (line_interpolate_point <cid:part3.04040903.00000406 en gmail.com>) or
    a substring (line_substring <cid:part7.06010302.02090102 en gmail.com>).

    Availability: 1.1.0

locate_along_measure(geometry, float8)

    Return a derived geometry collection value with elements that match
    the specified measure. Polygonal elements are not supported.

    Semantic is specified by: ISO/IEC CD 13249-3:200x(E) - Text for
    Continuation CD Editing Meeting

    Availability: 1.1.0

locate_between_measures(geometry, float8, float8)

    Return a derived geometry collection value with elements that match
    the specified range of measures inclusively. Polygonal elements are
    not supported.

    Semantic is specified by: ISO/IEC CD 13249-3:200x(E) - Text for
    Continuation CD Editing Meeting

    Availability: 1.1.0


jaume domí­nguez faus escribió:
> Con la geometría extraída ya es muy fácil de hacer:
>
> FShape path = tuGeometría;
> PathLength pl = new PathLength(path);
> Point2D p = pl.pointAtLength(floatTuDistancia);
>
> ten en cuenta la concordancia de unidades en la geometría y ya.
>
> Salut!
>
>
> xan das bolas wrote:
>> Buenas Tardes , me gustaría saber si a la hola de conocer un punto 
>> que se encuentra a una determinada distancia dentro de una linestring 
>> o multilinestring, se puede hacer mediante una consulta a postgis o 
>> por el contrario hay que hacerlo de forma manual sobre la geometria 
>> una vez extraida de la BD.Es decir si tenemos una linea que 
>> representa un rio y queremos saber en que punto esta el km 10 , hay 
>> alguna consulta que nos lo devuelva o hay que sacar la geometria del 
>> rio e ir trabajando con ella en nuestra programa.
>>
>> Muchas Gracias
>>
>> _________________________________________________________________
>> Grandes éxitos, superhéroes, imitaciones, cine y TV... 
>> http://es.msn.kiwee.com/ Lo mejor para tu móvil.
>> _______________________________________________
>> gvSIG_desarrolladores mailing list
>> gvSIG_desarrolladores en runas.cap.gva.es
>> http://runas.cap.gva.es/mailman/listinfo/gvsig_desarrolladores
>
> _______________________________________________
> gvSIG_desarrolladores mailing list
> gvSIG_desarrolladores en runas.cap.gva.es
> http://runas.cap.gva.es/mailman/listinfo/gvsig_desarrolladores
>


Más información sobre la lista de distribución gvSIG_desarrolladores