[GRASS-user] Apply arbitrary edit to all coordinates in a vector

Ken Mankoff mankoff at gmail.com
Wed Mar 14 10:16:18 PDT 2018


One solution is to export, pipe through invproj, and re-import:


v.out.ascii Z layer=-1 -c format=standard output=Zproj --o

rm Zrot
regex="[-]\d*\.\d*\s*\d*\.\d*"
while read line; do
  if [[ $line =~ $regex ]]; then
    echo $line | invproj -f "%f" +proj=ob_tran +o_proj=latlon +o_lon_p=-200
+o_lat_p=18 +lon_0=180 -m 57.295779506 >> Zrot
  else
    echo $line >> Zrot
  fi
done < Zproj

  -k.


On Tue, Mar 13, 2018 at 3:06 PM, Ken Mankoff <mankoff at gmail.com> wrote:

>
>
> On Tue, Mar 13, 2018 at 1:05 PM, Ken Mankoff <mankoff at gmail.com> wrote:
>
>>
>>
>> On Tue, Mar 13, 2018 at 12:21 PM, Helmut Kudrnovsky <hellik at web.de>
>> wrote:
>>
>>> Ken Mankoff wrote
>>> > Is there a way to take an arbitrary vector from
>>> > GRASS and apply an arbitrary transformation to each element? v.edit
>>> has a
>>> > move feature, but this is not what I want.
>>> >
>>>
>>> v.transform - Performs an affine transformation (shift, scale and
>>> rotate) on
>>> vector map.
>>> https://grass.osgeo.org/grass74/manuals/v.transform.html
>>>
>>> not sure it is what you're looking for.
>>>
>>
>> Yes that would do it just fine. Unfortunately I'm not sure how to get the
>> transformation matrix that invproj uses. I'll try to figure this out...
>>
>>
> Actually this does not work because I'm in EPSG:4326 (lon,lat) location
> and there are scaling issues. I think I need to access proj directly for
> all vertices...
>
>   -k.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20180314/aa52f2be/attachment.html>


More information about the grass-user mailing list