Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 761779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:52:45+00:00 2026-05-14T15:52:45+00:00

Imagine a GPS tracking system that is following the position of several objects. The

  • 0

Imagine a GPS tracking system that is following the position of several objects. The points are stored in a database (PostgreSQL + PostGIS).

Each path is composed by a different number of points. That is the reason why, in order to compare a pair of paths (compare the whole path), I want to divide every path in a set of 100 points. This is the problem. Do you know any PostGIS function that already implement this algorithm? I’ve not been able to find it.

If not, I’d like to solve it using Java. In this case I’d like to know an efficient and easy to implement algorithm to divide a path into N points.

The most simple example could be to divide this four-points-path into eight points:

position 1 : x=1, y=2
position 2 : x=2, y=4
position 3 : x=3, y=6
position 4 : x=4, y=8

And the result should be:

position 1 : x=1, y=2 (starting point)
position 2 : x=1.5, y=3
position 2 : x=2, y=4
position 2 : x=2.5, y=5
position 2 : x=3, y=6
position 2 : x=3.5, y=7
position 2 : x=4, y=8 (ending point)

Edit: By ‘compare a pair of paths’ I mean to calculate the distance between two complete paths. I plan to divide each path in 100 points, and sum the euclidean distance between each one of these points as the distance between the two paths.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T15:52:46+00:00Added an answer on May 14, 2026 at 3:52 pm

    I’m not certain I understand exactly what you want. Nonetheless, this PostGIS query will take a single line and spit out one hundred points equally spaced along that line:

    SELECT ST_AsText(
      ST_Line_Interpolate_Point(
        ST_GeomFromText('LINESTRING(0 0, 1 2, 10 2)'),
        generate_series(0, 100):: double precision / 100
      )
    );
    

    Obviously you would use real geometry rather than ST_GeomFromText(..), and would not include the ST_AsText(…) call. The result, as text, is:

                      st_astext                  
    ---------------------------------------------
     POINT(0 0)
     POINT(0.0502492235949962 0.100498447189992)
     POINT(0.100498447189992 0.200996894379985)
     POINT(0.150747670784989 0.301495341569977)
     POINT(0.200996894379985 0.40199378875997)
     POINT(0.251246117974981 0.502492235949962)
     POINT(0.301495341569977 0.602990683139955)
     POINT(0.351744565164974 0.703489130329947)
     POINT(0.40199378875997 0.803987577519939)
     POINT(0.452243012354966 0.904486024709932)
     POINT(0.502492235949962 1.00498447189992)
     POINT(0.552741459544958 1.10548291908992)
     POINT(0.602990683139955 1.20598136627991)
     POINT(0.653239906734951 1.3064798134699)
     POINT(0.703489130329947 1.40697826065989)
     POINT(0.753738353924943 1.50747670784989)
     POINT(0.803987577519939 1.60797515503988)
     POINT(0.854236801114936 1.70847360222987)
     POINT(0.904486024709932 1.80897204941986)
     POINT(0.954735248304928 1.90947049660986)
     POINT(1.01114561800017 2)
     POINT(1.12350629777517 2)
     POINT(1.23586697755016 2)
     POINT(1.34822765732516 2)
     POINT(1.46058833710016 2)
     POINT(1.57294901687516 2)
     POINT(1.68530969665016 2)
     POINT(1.79767037642515 2)
     POINT(1.91003105620015 2)
     POINT(2.02239173597515 2)
     POINT(2.13475241575015 2)
     POINT(2.24711309552515 2)
     POINT(2.35947377530014 2)
     POINT(2.47183445507514 2)
     POINT(2.58419513485014 2)
     POINT(2.69655581462514 2)
     POINT(2.80891649440013 2)
     POINT(2.92127717417513 2)
     POINT(3.03363785395013 2)
     POINT(3.14599853372513 2)
     POINT(3.25835921350013 2)
     POINT(3.37071989327512 2)
     POINT(3.48308057305012 2)
     POINT(3.59544125282512 2)
     POINT(3.70780193260012 2)
     POINT(3.82016261237512 2)
     POINT(3.93252329215011 2)
     POINT(4.04488397192511 2)
     POINT(4.15724465170011 2)
     POINT(4.26960533147511 2)
     POINT(4.38196601125011 2)
     POINT(4.4943266910251 2)
     POINT(4.6066873708001 2)
     POINT(4.7190480505751 2)
     POINT(4.8314087303501 2)
     POINT(4.9437694101251 2)
     POINT(5.05613008990009 2)
     POINT(5.16849076967509 2)
     POINT(5.28085144945009 2)
     POINT(5.39321212922509 2)
     POINT(5.50557280900008 2)
     POINT(5.61793348877508 2)
     POINT(5.73029416855008 2)
     POINT(5.84265484832508 2)
     POINT(5.95501552810008 2)
     POINT(6.06737620787507 2)
     POINT(6.17973688765007 2)
     POINT(6.29209756742507 2)
     POINT(6.40445824720007 2)
     POINT(6.51681892697506 2)
     POINT(6.62917960675006 2)
     POINT(6.74154028652506 2)
     POINT(6.85390096630006 2)
     POINT(6.96626164607506 2)
     POINT(7.07862232585005 2)
     POINT(7.19098300562505 2)
    POINT(7.30334368540005 2)
     POINT(7.41570436517505 2)
     POINT(7.52806504495005 2)
     POINT(7.64042572472504 2)
     POINT(7.75278640450004 2)
     POINT(7.86514708427504 2)
     POINT(7.97750776405004 2)
     POINT(8.08986844382504 2)
     POINT(8.20222912360003 2)
     POINT(8.31458980337503 2)
     POINT(8.42695048315003 2)
     POINT(8.53931116292503 2)
     POINT(8.65167184270003 2)
     POINT(8.76403252247502 2)
     POINT(8.87639320225002 2)
     POINT(8.98875388202502 2)
     POINT(9.10111456180002 2)
     POINT(9.21347524157501 2)
     POINT(9.32583592135001 2)
     POINT(9.43819660112501 2)
     POINT(9.55055728090001 2)
     POINT(9.66291796067501 2)
     POINT(9.77527864045 2)
     POINT(9.887639320225 2)
     POINT(10 2)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Imagine you are simulating particle physics. You, then, have a position vector for each
Imagine you have a website with several drop-downs that are populated from the back-end
Imagine the following scenario: I have a list of Labels stored in a table
Imagine I have following table: NAME DATE OTHER_CONTANT 'A' '2012-06-05' 'baz' 'A' '2012-06-04' 'bar'
Imagine you have two views with code like the following: controller_a/a.html.erb <%= content_tag(:div) do
Imagine I've got a database with lots of data, from which users can search.
Imagine that I use a state file to store a number, I read the
Imagine that you table viewController and you have element called settingDate in one of
Imagine if you will a layout that contains a circle within an elipse. The
We're building a GIS interface to display GPS track data, e.g. imagine the raw

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.