[GRASS-dev] [GRASS GIS] #1918: Missing $(RASTERLIB) $(RASTERDEP) in vector/v.in.region/Makefile

#1918: Missing $(RASTERLIB) $(RASTERDEP) in vector/v.in.region/Makefile
-------------------------+--------------------------------------------------
Reporter: torsti | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Vector | Version: svn-trunk
Keywords: | Platform: Linux
      Cpu: Unspecified |
-------------------------+--------------------------------------------------
r55629 #include <raster.h> was added to main.c in v.in.region and it now
uses symbols declared in raster.h there but wasn't an update to the
Makefile, so for me compilation fails with a linker error:

{{{
make
: && gcc -L/home/torsti/Lataukset/Kehitys/grass_trunk/dist.x86_64-unknown-
linux-gnu/lib -L/home/torsti/Lataukset/Kehitys/grass_trunk/dist.x86_64
-unknown-linux-gnu/lib -Wl,--export-dynamic -Wl,-rpath-
link,/home/torsti/Lataukset/Kehitys/grass_trunk/dist.x86_64-unknown-linux-
gnu/lib -o /home/torsti/Lataukset/Kehitys/grass_trunk/dist.x86_64
-unknown-linux-gnu/bin/v.in.region OBJ.x86_64-unknown-linux-gnu/main.o
-lgrass_vector.7.0.svn -lgrass_gis.7.0.svn -lm
/usr/bin/ld: OBJ.x86_64-unknown-linux-gnu/main.o: undefined reference to
symbol 'Rast_row_to_northing'
/usr/bin/ld: note: 'Rast_row_to_northing' is defined in DSO
/home/torsti/Lataukset/Kehitys/grass_trunk/dist.x86_64-unknown-linux-
gnu/lib/libgrass_raster.7.0.svn.so so try adding it to the linker command
line
/home/torsti/Lataukset/Kehitys/grass_trunk/dist.x86_64-unknown-linux-
gnu/lib/libgrass_raster.7.0.svn.so: could not read symbols: Invalid
operation
collect2: error: ld returned 1 exit status
make: *** [/home/torsti/Lataukset/Kehitys/grass_trunk/dist.x86_64-unknown-
linux-gnu/bin/v.in.region] Virhe 1
}}}

I guess it should be something like this:

{{{
Index: vector/v.in.region/Makefile

--- vector/v.in.region/Makefile (revision 55638)
+++ vector/v.in.region/Makefile (working copy)
@@ -5,9 +5,9 @@

  include $(MODULE_TOPDIR)/include/Make/Module.make

-DEPENDENCIES = $(VECTORDEP) $(GISDEP)
+DEPENDENCIES = $(VECTORDEP) $(RASTERDEP) $(GISDEP)

-LIBES = $(VECTORLIB) $(GISLIB)
+LIBES = $(VECTORLIB) $(RASTERLIB) $(GISLIB)

  EXTRA_INC = $(VECT_INC)
  EXTRA_CFLAGS = $(VECT_CFLAGS)
}}}

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1918&gt;
GRASS GIS <http://grass.osgeo.org>

#1918: Missing $(RASTERLIB) $(RASTERDEP) in vector/v.in.region/Makefile
---------------------+------------------------------------------------------
  Reporter: torsti | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.0.0
Component: Vector | Version: svn-trunk
Resolution: fixed | Keywords:
  Platform: Linux | Cpu: Unspecified
---------------------+------------------------------------------------------
Changes (by neteler):

  * status: new => closed
  * resolution: => fixed

Comment:

Thanks, added in r55639. Closing.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1918#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#1918: Missing $(RASTERLIB) $(RASTERDEP) in vector/v.in.region/Makefile
---------------------+------------------------------------------------------
  Reporter: torsti | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.0.0
Component: Vector | Version: svn-trunk
Resolution: fixed | Keywords: v.in.region
  Platform: Linux | Cpu: Unspecified
---------------------+------------------------------------------------------
Changes (by hamish):

  * keywords: => v.in.region

Comment:

from the v.in.region help page:

  "If the output of <em>v.in.region</em> is to be used for raster
reprojection, the <em>-d</em> flag should be used after setting the
region to the raster map to be reprojected with
<em><a href="r.proj.html">r.proj</a></em>."

It would be good to explain why, and what the flag does to solve it.

thanks,
Hamish

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1918#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#1918: Missing $(RASTERLIB) $(RASTERDEP) in vector/v.in.region/Makefile
---------------------+------------------------------------------------------
  Reporter: torsti | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.0.0
Component: Vector | Version: svn-trunk
Resolution: fixed | Keywords: v.in.region
  Platform: Linux | Cpu: Unspecified
---------------------+------------------------------------------------------

Comment(by mmetz):

Replying to [comment:2 hamish]:
> from the v.in.region help page:
>
> "If the output of <em>v.in.region</em> is to be used for raster
> reprojection, the <em>-d</em> flag should be used after setting the
> region to the raster map to be reprojected with
> <em><a href="r.proj.html">r.proj</a></em>."
>
> It would be good to explain why, and what the flag does to solve it.

From the r.proj manual:
"A more involved, but more accurate, way to do this is to generate a
vector "box" map of the region in the source location using v.in.region.
This "box" map is then reprojected into the target location with v.proj.
Next the region in the target location is set to the extent of the new
vector map with g.region along with the desired raster resolution [...]."

The extents of the reprojected vector map are often smaller than the
extents of the reprojected raster map would be, because v.in.region only
creates points at the box corners. If additional vertices are inserted
according to the raster resolution, the extents of the reprojected vector
are different, i.e. larger. In the attached screenshot, the standard
reprojected vector is in red, the densified vector is in blue. The source
projection was European LAEA (EPSG:3035), the target projection was
latlong. The effect of the -d flag for v.in.region is similar to the
effect of the -p flag for r.proj.

Markus M

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1918#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>