Hi Debbie,
You can use the same solution as I gave a couple of days ago using areas:
You can use the Overlap-function to retrieve the common area between the roads
and the polygons:
Select POLGONID, ROADID,
CartesianObjectLen(Overlap(ROADTABLE.OBJ, POLYGONTABLE.OBJ), "m")
"Overlap_Length_m"
CartesianObjectLen(ROADTABLE.OBJ, "m") "Total_Length_m"
>From ROADTABLE, POLYGONTABLE
Where ROADTABLE.OBJ Intersects POLYGONTABLE.OBJ
Where:
- POLYGONID is some column in the tables with polygons that you can use to
identify the polygons
- ROADID is some column in the tables with roads that you can use to identify
the roads
- ROADTABLE is the name of the table with the roads
- POLYGONTABLE is the name of the table with the polygons
- CartesianObjectLen(..., "sq m") is the function used for calculating the
length, you could also use "mi", "km", etc.
You could also use SpericalObjectLen() if you prefer the Sperical Length.
- "Overlap_Length_m" is an alias for the column holding length of the road
within the polygon
- "Total_Length_m" is an alias for the column holding the length of the entire
road
- Overlap() returns the common object of the two objects
With some luck you can also add the propertion calcualtion to the same SQL
Statement (just add this line before the line with "From ROAD...":
, CartesianObjectLen(Overlap(ROADTABLE.OBJ, POLYGONTABLE.OBJ), "m")
/CartesianObjectLen(ROADTABLE.OBJ, "m") "Propertion"
HTH,
Peter Horsb�ll M�ller
GIS Developer
Geographical Information & IT
COWI A/S
Odensevej 95
DK-5260 Odense S.
Denmark
Tel +45 6311 4900
Direct +45 6311 4908
Mob +45 5156 1045
Fax +45 6311 4949
E-mail [EMAIL PROTECTED]
http://www.cowi.dk/gis
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 26, 2005 4:53 PM
To: [email protected]
Subject: MI-L Calculating the proportion of lines within polygons
Hi
I have two layers - one with polygons and one with a road network
represented by lines. I would like to know the length of road links within
each polygon. However, some road links cross the polygon boundary. For
these, I would like to know what proportion of the link lies within the
polygon.
Does anyone know how to calculate the proportion of a line lying within a
polygon? I have tried using the 'ProportionOverlap' command in SQL select,
but this doesn't seem to work. Has anyone faced this problem before?
Thanks,
Debbie
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com | To
unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 15002
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 15003