Solved

Line Length - Geometry Field?

Posted on 2013-02-06
6
550 Views
Last Modified: 2015-01-05
Within my GIS Package there is the local Length or Area of a measurment. Each Line or Area is stored in SQL Server. This is a function only in my GIS Package its currently not a column in the SQL table. Its calculated live on the fly only in the GIS package

Is there a way within SQL Server to determine the Length of a Line Feature on the fly?

Then i need to build a query like this?
First Step
I need a query that will the determine the length of the line is "X" meters.
Second Step
The total address range(Smallest # of the 4 columns) and (Largest # of the 4 columns) in this case the address range is 1-400. That will come from  these 4 existing columns L_F_ADD(1), L_T_ADD , R_F_ADD, R_T_ADD(400).
Third Step  
Calculate the length of the line(Step 1) (divided by 15.25m) then multiplied by 2, . This will give me the total amount of address numbers there should be.
Forth Step
Are the Total Address #'s (Step 3) within 10% of the Actual address numbers on the Road(Step 2). If not flag a column (RangeError).
0
Comment
Question by:PtboGiser
  • 3
  • 2
6 Comments
 

Author Comment

by:PtboGiser
ID: 38860377
I have also posted this on the GIS Software package site. I would prefer doing it in SQL server as i know this software won't change. We may be changing GIS Packages shortly so that query will be retired at that point,
Thanks
0
 
LVL 32

Expert Comment

by:awking00
ID: 38860542
Not sure I completely understand what you're trying to accomplish. Can you post some sample data and your expected output?
0
 

Author Comment

by:PtboGiser
ID: 38861245
Is there a length field somewhere is SQL Server? So i can find out the Length of a Line to query its results?
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
LVL 48

Assisted Solution

by:PortletPaul
PortletPaul earned 500 total points
ID: 38861759
the [unstated] GIS package seems to store lines and areas, but not length of line, which is calculated 'on the fly'.

You want that length of line, and then perform some additional arithmetic with that value.

Does the GIS package have an api?
(i.e. can it return the calculated value to you? perhaps it has a web service?)
Or can you scrape that value from (say) a url?

From what I understand of the subsequent arithmetic - that won't be a problem. Getting the initial length value  is the hard bit.
0
 

Author Comment

by:PtboGiser
ID: 38863843
I can get the Length from the GIS Software (Manifold GIS) and populate it in the table but then it becomes static data i need to run a query to update. I was hoping to keep the data "Live"
I'll work with it that way.
0
 
LVL 48

Accepted Solution

by:
PortletPaul earned 500 total points
ID: 38865464
Ok, so is there anything else required on this question?
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now