Skip to content
Back to formatted view

Raw Message

Message-ID: <b16cc562-cb80-09b1-18d1-d4d5ae2b9d01@comcast.net>
Date: 2019-01-31T18:05:29Z
From: David Winsemius
Subject: Extract the coordinates of a Polylines
In-Reply-To: <CANTxAm+o1dCKiPc7wdHO9jVB=frN4h=2E5-iq4zT7ARoKNG_XA@mail.gmail.com>

On 1/30/19 7:12 AM, javad bayat wrote:
> Dear all;
> Back to my previous question, I am trying to add X and Y coordinates 
> to every row of the data.
>
> topo = 
> readOGR("E:/New/Modelling_Water/MIKE/BathyMetry/GIS_Armator/Chitgar_Topo.shp")#Read 
> shape file of the topo as polylines
> plot(topo)
> cords = topo at lines[[1]]@Lines[[1]]@coords###Extracting X and Y 
> coordinates of the polylines of topo
>
> head(topo at data)
> ? FID_? ? ?Entity? ? ? ?Layer Color? ?Linetype Elevation
> ? ? 0 LWPolyline C-TOPO-MAJR? ? ?9 Continuous? ? 1258.0
> ? ? 0 LWPolyline C-TOPO-MAJR? ? ?9 Continuous? ? 1258.5
> ? ? 0 LWPolyline C-TOPO-MAJR? ? ?9 Continuous? ? 1258.5
> ? ? 0 LWPolyline C-TOPO-MAJR? ? ?9 Continuous? ? 1258.5
> ? ? 0 LWPolyline C-TOPO-MAJR? ? ?9 Continuous? ? 1258.5
> ? ? 0 LWPolyline C-TOPO-MAJR? ? ?9 Continuous? ? 1258.5


I did a google-search on "lwpolyline" and it appears to be a structure 
that is created with AutoCAD. So it's unlikely that people who are 
primarily users of R's spatial data structures will know how rgdal 
(which is a layer on top of GDAL) will have implemented the importation 
of such a structure into R. You should instead provide the output of 
`dput (head(topo at data) )` if you want more informed comments.


David.

>
> How can I do this.
> Sincerely.
>
> On Sat, Jan 26, 2019 at 9:37 AM javad bayat <j.bayat194 at gmail.com 
> <mailto:j.bayat194 at gmail.com>> wrote:
>
>     Dear R users;
>     I am trying to extract the X and Y coordinates of a polylines
>     along with Elevation data. I have extracted the Elevations as Z,
>     but I do not know how to extract the X and Y of these Elevations.
>     Is it possible to extract X and Y of the Elevation and create a
>     data frame with three variables?
>
>     line = readOGR("E:/......../Topo.shp")
>     Z = line at data$Elevation
>
>     Sincerely.
>
>     -- 
>     Best Regards
>     Javad Bayat
>     M.Sc. Environment Engineering
>     Alternative Mail: bayat194 at yahoo.com <mailto:bayat194 at yahoo.com>
>
>
>
> -- 
> Best Regards
> Javad Bayat
> M.Sc. Environment Engineering
> Alternative Mail: bayat194 at yahoo.com <mailto:bayat194 at yahoo.com>

	[[alternative HTML version deleted]]