[GRASS-SVN] r56677 - grass/branches/develbranch_6/vector/v.in.ogr
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Jun 10 12:56:53 PDT 2013
Author: mmetz
Date: 2013-06-10 12:56:53 -0700 (Mon, 10 Jun 2013)
New Revision: 56677
Modified:
grass/branches/develbranch_6/vector/v.in.ogr/main.c
Log:
v.in.ogr: use frexp, ldexp instead of log2, pow
Modified: grass/branches/develbranch_6/vector/v.in.ogr/main.c
===================================================================
--- grass/branches/develbranch_6/vector/v.in.ogr/main.c 2013-06-10 19:42:22 UTC (rev 56676)
+++ grass/branches/develbranch_6/vector/v.in.ogr/main.c 2013-06-10 19:56:53 UTC (rev 56677)
@@ -1183,13 +1183,14 @@
Vect_build(&Map);
- if (n_polygons) {
+ if (n_polygons && nlayers == 1) {
ncentr = Vect_get_num_primitives(&Map, GV_CENTROID);
/* this test is not perfect:
* small gaps (areas without centroid) are not detected
* because they may be true gaps */
if (ncentr != n_polygons || n_overlaps) {
double new_snap;
+ int exp;
Vect_get_map_box(&Map, &box);
@@ -1205,8 +1206,9 @@
if (xmax < ymax)
xmax = ymax;
- new_snap = log(xmax)/log(2) - 52;
- new_snap = pow(2, new_snap);
+ new_snap = frexp(xmax, &exp);
+ exp -= 52;
+ new_snap = ldexp(new_snap, exp);
new_snap = log10(new_snap);
if (new_snap < 0)
new_snap = (int)new_snap;
More information about the grass-commit
mailing list