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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T15:39:31+00:00 2026-06-16T15:39:31+00:00

I have got a task where in I have to Draw 2 lines on

  • 0

I have got a task where in I have to Draw 2 lines on Google Map (4 Points) and on Submit event I need to display the Vehicle passing through that points. I am able to draw 2 lines on google map which gives me 4 points in Lat/Longitude format.

Now the main questions is how can I query the database to get the Vehicle passing through two lines. I know I might have to use LineString function in T-SQL but how do i get all the vehicle passing through that lines? Any suggestions is welcome.

  • 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-06-16T15:39:32+00:00Added an answer on June 16, 2026 at 3:39 pm

    Given that I’m not sure how you are representing your “car” or your “lines” and must make assumptions, this code sample might be able to get the ball rolling for you.
    It will return a dataset indicating which cars have passed through which lines.
    Spatial queries are not my forte; perhaps someone else could offer an optimisation.

    --  This is the first line as describer by 2 points
    DECLARE @line1  GEOMETRY = geometry::STGeomFromText('LINESTRING(0 10, 10 10)', 0)
    --  This is the second line as describer by another 2 points
    DECLARE @line2  GEOMETRY = geometry::STGeomFromText('LINESTRING(0 20, 10 20)', 0)
    --  @Car1's path is represented as a line that does NOT intersect the 2 defined lines above
    DECLARE @Car1   GEOMETRY = geometry::STGeomFromText('LINESTRING(5 0, 5 11)', 0)
    --  @Car2's path is represented as a line that DOES intersect that 2 defined lines above
    DECLARE @Car2   GEOMETRY = geometry::STGeomFromText('LINESTRING(5 0, 5 23)', 0)
    
    ;WITH Lines (LineID, LineGeom) AS
    (
        SELECT 1, @line1    UNION ALL
        SELECT 2, @line2
    )
    ,Cars (CarID, CarGeom) AS
    (
        SELECT 1, @Car1 UNION ALL
        SELECT 2, @Car2
    )
    SELECT   C.CarID
            ,L.LineID
    FROM Cars   C
    JOIN Lines  L ON L.LineGeom.STIntersects(C.CarGeom) = 1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have got 3 tables: Event, task, task_handler. EVENT: event_id|name TASK_HANDLER: event_id|task_seq|handler TASK: event_id|task_seq|script
I am new in Java and have got as a task to find out,
i have got <div><a class='link' href='index.php' data-container='target'>Load</a></div> <div class='target'></div> i need to write jquery
I have got a task to do knockout.js in ruby on rails. I want
Hello guru of programming! Today I have got the task from my manager to
Recently I got a task that is to draw circles on my own website
I have got a new task.I am generating a pdf in php.So can any
I have just got a task in a new project which is implemented using
I have got a task table in my database with a priority field containing
I have got the the next task recently: increment the version of the sharepoint

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.