Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#1918 closed defect (fixed)

Missing $(RASTERLIB) $(RASTERDEP) in vector/v.in.region/Makefile

Reported by: torsti Owned by: grass-dev@…
Priority: normal Milestone: 7.0.0
Component: Vector Version: svn-trunk
Keywords: v.in.region Cc:
CPU: Unspecified Platform: Linux

Description

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)

Attachments (1)

dense_points_effect.png (24.5 KB) - added by mmetz 7 years ago.
reprojection of corner points (red) and dense points (blue)

Download all attachments as: .zip

Change History (4)

comment:1 Changed 7 years ago by neteler

Resolution: fixed
Status: newclosed

Thanks, added in r55639. Closing.

comment:2 Changed 7 years ago by hamish

Keywords: v.in.region added

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

comment:3 in reply to:  2 Changed 7 years ago by mmetz

Replying to 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

Changed 7 years ago by mmetz

Attachment: dense_points_effect.png added

reprojection of corner points (red) and dense points (blue)

Note: See TracTickets for help on using tickets.