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 7443449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:19:53+00:00 2026-05-29T11:19:53+00:00

(note: the_geom is a geometry value (TYPE: LINESTRING), in this case i random them

  • 0

(note: the_geom is a geometry value (TYPE: LINESTRING), in this case i random them for readability)

gid | kstart  | kend    | ctrl_sec_no | the_geom | the_sum_geom
626 | 238     | 239     | 120802      | 123456   | NULL
638 | 249     | 250     | 120802      | 234567   | NULL
4037| 239     | 249     | 120802      | 345678   | NULL

[Real Practice Description] just skip this for those who don’t mind the purpose

I would like to do ‘this’ (a set of queries from my past question, link
located on the end of this post) for every row in Table B (aka.
land_inventory). These two tables are related by ‘ctrl_sec_no’
(aka. control section number of a road) which means :: in ONE
ctrl_sec_no — 120802 (in fact, it is a road which is equivalent to 3
geometry LINESTRINGs (the_geom) connected together, from kstart 238 (start at kilometre of 238) to kend 250)

[PostGIS question]

the question is how to connect this 3 lines {aka gid(626,638,4037) from the table} together and result in ‘the_sum_geom’ (initially NULL) by using PostGIS functions (whatever). after that we will use this ‘the_sum_geom’ to find the POINT on this geometry LINESTRING

(How calculate things from many tables by using a few queries?).

  • 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-29T11:19:54+00:00Added an answer on May 29, 2026 at 11:19 am

    The function you are looking for is ST_Union, you need to use it with the aggregate form:

    update mytable set the_sum_geom = 
    ST_LineMerge( ( select ST_Union(the_geom) from mytable where ctrl_sec_no  = 120802 ) )
    where ctrl_sec_no = 120802;
    

    With ST_LineMerge you can convert from Multiline to LineString but there is a caveat, if the multi line cant be merged it will return the multiline without any modification. See the ST_LineMerge docs to understand what ST_LineMerge can or can’t do.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my test case (note the WTF comment): TEST(string_assignment) { std::string str; std::string
Note : The code in this question is part of deSleeper if you want
I have the VS2005 standard edition and MS says this: Note: The Windows Service
Reading this question I found this as (note the quotation marks) code to solve
Note the tag: VBA , not VB6, not VB.NET. This is specific to VBA
Note: The author of this question has some Java background, but is a complete
Note the table below. I am wanting to set the default value for the
Note: The title of this was changed to better reflect the actual problem. I've
I have a query that looks a bit like this (note: the actual query
Consider this XML file. Note the first Tutorial has an Author child element, and

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.