Solved

Line Length - Geometry Field?

Posted on 2013-02-06
6
548 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 31

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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly‚ÄĒanytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
sql query 7 35
SQL server 2008 SP4 29 33
Complex SQL 10 33
SQL Server can be started but not accessed 1 15
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 extract information from SQL Server on Database, Connection and Server properties
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

705 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

23 Experts available now in Live!

Get 1:1 Help Now