Re: [GRASS-user] v.to.db fails

2018-08-11 Thread Helmut Kudrnovsky
>   Creating a new location specifying EPSG:4326 created the location, but
did
>not produce a PROJ_INFO file so I could not reproject the map imported
>there. 

not confirmed here; creating a  new location with EPSG:4326 creates
following:

g.proj -p   
-PROJ_INFO-
name   : WGS 84
datum  : wgs84
ellps  : wgs84
proj   : ll
no_defs: defined
towgs84: 0.000,0.000,0.000
-PROJ_EPSG-
epsg   : 4326
-PROJ_UNITS
unit   : degree
units  : degrees
meters : 1.0

and produces following file:

D:\grassdata\test_epsg4326\PERMANENT>ls
DEFAULT_WIND  MYNAME  PROJ_EPSG  PROJ_INFO  PROJ_UNITS  WIND



-
best regards
Helmut
--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] v.to.db fails

2018-08-10 Thread Rich Shepard

On Fri, 10 Aug 2018, Helmut Kudrnovsky wrote:


shouldn't you re-project your vector data?


Helmut,

  I just confirmed what I had observed before when importing lon/lat data:
an unusual location creation result.

  Creating a new location specifying EPSG:4326 created the location, but did
not produce a PROJ_INFO file so I could not reproject the map imported
there.

  Removing that directory and creating it using the proj.4 code:
+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs
works and produces both PROJ_INFO and PROJ_UNITS files.

Rich
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] v.to.db fails

2018-08-10 Thread Rich Shepard

On Fri, 10 Aug 2018, Helmut Kudrnovsky wrote:


how do you convert an attribute table from lat/lon to EPSG:2838?
shouldn't you re-project your vector data?


Helmut,

  Perhaps I did not directly import the original data into the EPSG:2838
location. That makes sense.

Thanks,

Rich
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] v.to.db fails

2018-08-10 Thread Helmut Kudrnovsky
 >Convert attribute table lon/lat to EPSG 2838: 

how do you convert an attribute table from lat/lon to EPSG:2838?

shouldn't you re-project your vector data?



-
best regards
Helmut
--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

[GRASS-user] v.to.db fails

2018-08-10 Thread Rich Shepard

  The precipitation file in my earlier thread replaced the lon/lat
coordinates with the projected coordinates after running v.to.db on the
table. Replacing the source table with one having two more columns (date and
precipitation amount) is failing the coordinate conversion somewhere, and I
fail to spot where.

  Source file fragment:

name,lon,lat,elev,date,prcp
Headworks Portland Water,-122.1547,45.4486,228.0,2005-01-01,0.59
Headworks Portland Water,-122.1547,45.4486,228.0,2005-01-02,0.08
Headworks Portland Water,-122.1547,45.4486,228.0,2005-01-03,0.10
Headworks Portland Water,-122.1547,45.4486,228.0,2005-01-04,0.00
Headworks Portland Water,-122.1547,45.4486,228.0,2005-01-05,0.00
Headworks Portland Water,-122.1547,45.4486,228.0,2005-01-06,0.02
Headworks Portland Water,-122.1547,45.4486,228.0,2005-01-07,0.05
Headworks Portland Water,-122.1547,45.4486,228.0,2005-01-08,0.10
Headworks Portland Water,-122.1547,45.4486,228.0,2005-01-09,0.00
Headworks Portland Water,-122.1547,45.4486,228.0,2005-01-10,0.02

  Import command:

v.in.ascii in=$HOME/projects/data/precipitation/precip.csv skip=1 out=precip
sep=comma columns='name varchar, lon double precision, lat double precision,
elev double precision, date varchar, prcp double precision' x=2 y=3 z=4 --o

  Convert attribute table lon/lat to EPSG 2838:
v.to.db map=precip opt=coor col=lon,lat --o

  Export re-projected precipitation data for use in R:
db.out.ogr in=precip out=rainfall for=CSV --o

  Output file fragment:

cat,name,lon,lat,elev,date,prcp
"1",Headworks Portland Water,-122.1547,45.4486,228,2005-01-01,0.59
"2",Headworks Portland Water,-122.1547,45.4486,228,2005-01-02,0.08
"3",Headworks Portland Water,-122.1547,45.4486,228,2005-01-03,0.1
"4",Headworks Portland Water,-122.1547,45.4486,228,2005-01-04,0
"5",Headworks Portland Water,-122.1547,45.4486,228,2005-01-05,0
"6",Headworks Portland Water,-122.1547,45.4486,228,2005-01-06,0.02
"7",Headworks Portland Water,-122.1547,45.4486,228,2005-01-07,0.05
"8",Headworks Portland Water,-122.1547,45.4486,228,2005-01-08,0.1
"9",Headworks Portland Water,-122.1547,45.4486,228,2005-01-09,0
"10",Headworks Portland Water,-122.1547,45.4486,228,2005-01-10,0.02

  Where have I gone off the tracks here? It worked before.

Rich

___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user