Thanks for the answer!

I think I surely have to use gIntersection then gLength for this purpose

I've tried gIntersection like this:
routes2 = gIntersection(routes, bdc)

But I get the following message:
Erreur dans createPolygonsComment(p) :
  rgeos_PolyCreateComment: orphaned hole, cannot find containing polygon for
hole at index 1

Do you have an idea why I get this message and how to correct it?



2011/6/7 Roman Luštrik <roman.lustrik@gmail.com>

> Package rgeos has all sorts of functions that might come handy.
>
> Cheers,
> Roman
>
>
>
> On Tue, Jun 7, 2011 at 6:13 PM, Mathieu Rajerison <
> mathieu.rajerison@gmail.com> wrote:
>
>> Hi,
>>
>>
>> I have a SpatialLines object representing roads and a SpatialPolygons
>> object
>> containing cities.
>>
>> I'd like to know how to overlay a SpatialLines object by aSpatialPolygons
>> object.
>>
>> I'd like to know the total distance of roads that cover each of my cities.
>>
>> Is it possible?
>>
>>
>> Thanks,
>>
>> Mathieu
>>
>>        [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>
>
>
> --
> In God we trust, all others bring data.
>

	[[alternative HTML version deleted]]

